Skip to content

Commit

Permalink
ci: Execute stryker:dry-run on branches (#302)
Browse files Browse the repository at this point in the history
Dry run works by passing a glob that matches no file.
Additionally we reduce the reporters since there is nothing to report anyways.

We decided to go for a CLI approach instead of a separate config file,
since there is no way to extend config files, and we would like to avoid
any need to keep the two files in sync.

stryker-mutator/stryker-js#3088

Co-authored-by: Christian Bewernitz <coder@karfau.de>
Co-authored-by: Christopher J. Brody <chris.brody+brodybits@gmail.com>
  • Loading branch information
karfau and brodybits committed Aug 27, 2021
1 parent 64647d1 commit cc097e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/stryker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ name: run Stryker - Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
Expand All @@ -23,6 +25,13 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run stryker

- if: ${{ github.event_name == 'pull_request' }}
# on pr branches we only do a dry-run that doesn't mutate anything but checks the configuration works
run: npm run stryker:dry-run

- if: ${{ github.event_name == 'push' }}
# on the default branch we run the full suite wich takes > 1 hour to run
run: npm run stryker
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"lint": "eslint lib test",
"start": "nodemon --watch package.json --watch lib --watch test --exec 'npm --silent run test && npm --silent run lint'",
"stryker": "stryker run",
"stryker:dry-run": "stryker run -m '' --reporters progress",
"test": "jest"
},
"engines": {
Expand Down

0 comments on commit cc097e5

Please sign in to comment.