diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aa7082..cb92ce2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [master] + branches: [main] pull_request: permissions: diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index f329da3..0546d79 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -2,7 +2,7 @@ name: Mutation on: push: - branches: [master] + branches: [main] pull_request: types: [opened, ready_for_review, synchronize, reopened] workflow_dispatch: @@ -11,7 +11,7 @@ permissions: contents: read concurrency: - group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || (github.event_name == 'push' && 'master') || github.run_id }} + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: @@ -37,20 +37,20 @@ jobs: - name: Rebuild mutation results if: github.event_name == 'push' run: npm run mutation -- --force - # Runs on master go one at a time and only the tip saves, so an older run cannot replace newer results. + # Runs on the default branch go one at a time and only the tip saves, so an older run cannot replace newer results. - name: Check baseline revision - id: master-tip + id: default-branch-tip if: ${{ !cancelled() && github.event_name == 'push' && hashFiles('reports/stryker-incremental.json') != '' }} shell: bash run: | - tip=$(git ls-remote --exit-code origin refs/heads/master) + tip=$(git ls-remote --exit-code origin "$GITHUB_REF") if [[ "${tip%%$'\t'*}" == "$GITHUB_SHA" ]]; then echo "current=true" >> "$GITHUB_OUTPUT" else echo "current=false" >> "$GITHUB_OUTPUT" fi - uses: actions/cache/save@v6 - if: ${{ !cancelled() && steps.master-tip.outputs.current == 'true' }} + if: ${{ !cancelled() && steps.default-branch-tip.outputs.current == 'true' }} with: path: reports/stryker-incremental.json key: mutation-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }} diff --git a/README.md b/README.md index 15b3ec6..6b301b5 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,4 @@ Run `npm install` at the root to install dependencies and link the packages decl - [index.html](index.html) is the entry page. Vite uses its defaults without a configuration file, including its browser target and no production source maps. - Vite transpiles TypeScript without type-checking. Run `npm run typecheck` to check types; `npm run verify-gate` includes it before the tests and build. - TypeScript is pinned to the 6.x line. -- Mutation testing uses [Stryker's incremental mode](https://stryker-mutator.io/docs/stryker-js/incremental/). Changes outside mutated source and test files can leave reused results stale; run `npm run mutation -- --force` for a fresh full run. CI does this on pushes to `master`. +- Mutation testing uses [Stryker's incremental mode](https://stryker-mutator.io/docs/stryker-js/incremental/). Changes outside mutated source and test files can leave reused results stale; run `npm run mutation -- --force` for a fresh full run. CI does this on pushes to the default branch.