-
-
Notifications
You must be signed in to change notification settings - Fork 1
ci(mutation): run mutation tests only when src/ or test/ changed #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,27 @@ concurrency: | |
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| # Detect whether this PR/push touches code that mutation testing covers. | ||
| # Infection is expensive, so the `infection` job below runs only when src/ | ||
| # or test/ changed — a docs-only or config-only change skips it. | ||
| changes: | ||
| name: Detect code changes | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| outputs: | ||
| code: ${{ steps.filter.outputs.code }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dorny/paths-filter@v3 | ||
| id: filter | ||
| with: | ||
| filters: | | ||
| code: | ||
| - 'src/**' | ||
| - 'test/**' | ||
|
Comment on lines
+29
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Declining. Accurate that on push to main, dorny deepens the shallow clone to reach But the suggested fix trades the wrong way:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right. The trade-off math is clearly against |
||
|
|
||
| phpunit: | ||
| # 8.4 is the supported/default runtime and runs the full suite minus the | ||
| # `php85` group; a dedicated 8.5 container runs only that group, which | ||
|
|
@@ -116,7 +137,10 @@ jobs: | |
| infection: | ||
| name: Mutation testing | ||
| runs-on: ubuntu-latest | ||
| needs: phpunit | ||
| # Only after unit tests pass, and only when src/ or test/ changed | ||
| # (see the `changes` job) — mutation is skipped for docs/config-only work. | ||
| needs: [phpunit, changes] | ||
| if: needs.changes.outputs.code == 'true' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.