feat: Matrix sharding support (v1.3.0)#4
Merged
Merged
Conversation
Adds two new inputs, `shard` and `shards-total`, so large test suites
can be split across parallel GitHub runners using Playwright's native
--shard=N/M flag. Turns a 30-minute job into ~5 minutes with a simple
GitHub Actions matrix.
Example workflow:
strategy:
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: Quality-Max/qualitymax-github-action@v1
with:
shard: ${{ matrix.shard }}
shards-total: 4
How it works:
- Each shard fetches the full suite from the QualityMax API
- Passes --shard=N/M to `npx playwright test`, which deterministically
partitions the files
- Reports its own slice's pass/fail back as a separate execution
Internal changes:
- action.yml: two new optional inputs
- src/types.ts: shard/shardsTotal on ActionInputs
- src/index.ts:
- Parse inputs with validation (both must be positive ints,
shard <= shardsTotal, else warn and run full suite)
- Append --shard=N/M to playwright args when sharding is active
- totalTests now derived from actual parsed results (not scripts.length)
so a shard running 25/100 tests reports 25, not 100
- Don't fabricate per-script rows from exit code when sharded (we
can't know which tests the shard ran without Playwright output)
- README: new "Matrix Sharding" example, inputs table updated
- Version: 1.2.1 → 1.3.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds matrix sharding so large test suites can be split across parallel GitHub runners. Turns a 30-minute job into ~5 minutes with a simple matrix strategy.
Usage
```yaml
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: Quality-Max/qualitymax-github-action@v1
with:
api-key: ${{ secrets.QUALITYMAX_API_KEY }}
project-name: 'My Web App'
shard: ${{ matrix.shard }}
shards-total: 4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Changes
Test plan
🤖 Generated with Claude Code