k6-action
k6-action copied to clipboard
Support glob patterns to select multiple tests for sequential execution
For instance: **/k6-tests/**/*.js
See examples:
https://github.com/grafana/k6-github-action https://github.com/grafana/quickpizza/blob/main/.github/workflows/k6-tests.yaml
+1 , I did some GitHub Action trickery to get such functionality working, but it can be awesome if this can be supported natively.
name: Grafana K6
on: workflow_dispatch
jobs:
list-scripts:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- id: set-matrix
run: echo "::set-output name=matrix::$(ls k6/*.js | jq -R -s -c 'split("\n")[:-1]')"
check:
needs: list-scripts
runs-on: ubuntu-latest
strategy:
matrix:
script: ${{ fromJson(needs.list-scripts.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- uses: grafana/[email protected]
with:
filename: ${{ matrix.script }}
flags: --vus 10 --duration 10s --tag test=${{ matrix.script }}
This is now supported in the new GH action: https://github.com/grafana/run-k6-action/