chore(deps): bump the npm-minor-patch group across 1 directory with 8 updates #258
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
| name: coverage | |
| on: | |
| pull_request: | |
| branches: [master, main] | |
| push: | |
| branches: [master, main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| coverage: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # Full history so diff-cover can resolve origin/<base_ref>. | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm test -- --coverage | |
| - uses: codecov/codecov-action@v7 | |
| if: always() | |
| with: | |
| fail_ci_if_error: false | |
| # ------------------------------------------------------------------ | |
| # Org patch-coverage mandate: every changed line in a PR diff must be | |
| # covered by a test (100%). Tool: diff-cover | |
| # (https://github.com/Bachmann1234/diff-cover). vitest's v8 provider | |
| # emits lcov with src/*.ts(x) paths + source-mapped line numbers, so it | |
| # lines up directly with the PR diff. `npm run gate` is untouched. | |
| # ------------------------------------------------------------------ | |
| - name: Generate lcov coverage | |
| if: github.event_name == 'pull_request' | |
| run: npx vitest run --coverage --coverage.provider=v8 --coverage.reporter=lcov --coverage.reportsDirectory=coverage | |
| - uses: actions/setup-python@v6 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| python-version: '3.12' | |
| - name: Install diff-cover | |
| if: github.event_name == 'pull_request' | |
| run: pip install diff-cover | |
| - name: Patch coverage gate (100% of changed lines) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| # Full base history (NOT --depth=1): a shallow base fetch shares no merge-base | |
| # with a PR branch that is behind base → diff-cover "no merge base" crash. | |
| git fetch origin "${{ github.base_ref }}" || true | |
| diff-cover coverage/lcov.info \ | |
| --compare-branch="origin/${{ github.base_ref }}" \ | |
| --fail-under=100 |