ci: bump actions/checkout from 6 to 7 #34
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Examples | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| push: | |
| tags-ignore: | |
| - v* | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish-local: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Scala | |
| uses: japgolly/setup-everything-scala@v4.1 | |
| - name: Publish k6-scala locally for all Scala versions | |
| run: sbt publishLocalDev | |
| - name: Upload ivy2 local artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ivy2-local-k6-scala | |
| path: ~/.ivy2/local/org.virtuslab/ | |
| retention-days: 1 | |
| scala-cli-api-examples: | |
| needs: publish-local | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example_file: [ | |
| "k6-batch", | |
| "k6-counter-metrics", | |
| "k6-crypto-operations", | |
| "k6-custom-metrics", | |
| "k6-form-data", | |
| "k6-gauge-metrics", | |
| # "k6-grpc-streaming", # TODO: Enable when mock server is implemented | |
| "k6-grpc", | |
| "k6-html-forms", | |
| "k6-html-parsing", | |
| "k6-json-responses", | |
| "k6-ramp-vus-scenario", | |
| "k6-rate-metrics", | |
| "k6-request", | |
| "k6-shared-array", | |
| "k6-single-request", | |
| "k6-timers", | |
| "k6-trend-metrics", | |
| "k6-webcrypto", | |
| "k6-websocket-connect", | |
| "k6-websockets-modern", | |
| "k6-websockets" | |
| ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download k6-scala local artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ivy2-local-k6-scala | |
| path: ~/.ivy2/local/org.virtuslab/ | |
| - name: Setup Scala | |
| uses: japgolly/setup-everything-scala@v4.1 | |
| - uses: coursier/cache-action@v8.1 | |
| - uses: VirtusLab/scala-cli-setup@v1.14 | |
| with: | |
| jvm: temurin:21 | |
| scala-cli-version: 1.12.3 | |
| - name: Build JS with scala-cli | |
| run: | | |
| scala-cli \ | |
| --power package examples/api-examples/${{ matrix.example_file }}.scala \ | |
| --js \ | |
| --js-emit-source-maps \ | |
| --js-module-kind commonjs \ | |
| -f \ | |
| --js-no-opt \ | |
| -o examples/api-examples/${{ matrix.example_file }}.js | |
| - name: Setup K6 | |
| uses: grafana/setup-k6-action@v1 | |
| # Examples export options with vus=1 (or custom scenarios); CLI flags shorten runs in CI. | |
| - name: Run local k6 test | |
| uses: grafana/run-k6-action@v1 | |
| with: | |
| debug: true | |
| flags: --vus 1 --duration 1s | |
| path: ./examples/api-examples/${{ matrix.example_file }}.js | |
| # k6-jslib facades use ES modules and URL imports; build with --js-module-kind esmodule. | |
| scala-cli-api-examples-esm: | |
| needs: publish-local | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example_file: [ | |
| "k6-jslib-utils", | |
| "k6-httpx-sessions", | |
| "k6-chaijs-assertions" | |
| ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download k6-scala local artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ivy2-local-k6-scala | |
| path: ~/.ivy2/local/org.virtuslab/ | |
| - name: Setup Scala | |
| uses: japgolly/setup-everything-scala@v4.1 | |
| - uses: coursier/cache-action@v8.1 | |
| - uses: VirtusLab/scala-cli-setup@v1.14 | |
| with: | |
| jvm: temurin:21 | |
| scala-cli-version: 1.12.3 | |
| - name: Build JS with scala-cli (ES module) | |
| run: | | |
| scala-cli \ | |
| --power package examples/api-examples/${{ matrix.example_file }}.scala \ | |
| --js \ | |
| --js-emit-source-maps \ | |
| --js-module-kind esmodule \ | |
| -f \ | |
| --js-no-opt \ | |
| -o examples/api-examples/${{ matrix.example_file }}.js | |
| - name: Setup K6 | |
| uses: grafana/setup-k6-action@v1 | |
| - name: Run local k6 test | |
| uses: grafana/run-k6-action@v1 | |
| with: | |
| debug: true | |
| flags: --vus 1 --duration 1s | |
| path: ./examples/api-examples/${{ matrix.example_file }}.js | |
| mill-example: | |
| needs: publish-local | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download k6-scala local artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ivy2-local-k6-scala | |
| path: ~/.ivy2/local/org.virtuslab/ | |
| - uses: coursier/setup-action@v3 | |
| with: | |
| jvm: temurin:21 | |
| apps: mill | |
| - name: Setup K6 | |
| uses: grafana/setup-k6-action@v1 | |
| - name: Build simulation file | |
| run: mill helloworld.fastOpt | |
| working-directory: ./examples/mill-helloworld | |
| - name: Run K6 simulation | |
| run: mill helloworld.runK6test | |
| working-directory: ./examples/mill-helloworld | |
| sbt-example: | |
| needs: publish-local | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download k6-scala local artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ivy2-local-k6-scala | |
| path: ~/.ivy2/local/org.virtuslab/ | |
| - name: Setup Scala | |
| uses: japgolly/setup-everything-scala@v4.1 | |
| - name: Setup K6 | |
| uses: grafana/setup-k6-action@v1 | |
| - name: Build simulation file | |
| run: sbt fastOptJS | |
| working-directory: ./examples/sbt-helloworld | |
| - name: Run K6 simulation | |
| run: sbt runK6test | |
| working-directory: ./examples/sbt-helloworld | |
| gradle-example: | |
| needs: publish-local | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download k6-scala local artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ivy2-local-k6-scala | |
| path: ~/.ivy2/local/org.virtuslab/ | |
| - name: Setup Scala | |
| uses: japgolly/setup-everything-scala@v4.1 | |
| - name: Setup K6 | |
| uses: grafana/setup-k6-action@v1 | |
| - name: Build and run K6 simulation | |
| run: ./gradlew :helloworld:runK6test | |
| working-directory: ./examples/gradle-helloworld |