Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,40 @@ jobs:
with:
name: test-coverage-${{ matrix.node-version }}
path: test/coverage

test-coverage:
name: Test coverage
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: '26.x'
cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Run tests
run: |
set -o pipefail
npm test -- --ci --coverage --runInBand 2>&1 |
tee "$RUNNER_TEMP/tests.txt"
# Reported in its own step so the summary is still written when the suite
# fails, which is when the test results are most worth reading.
- name: Report test results & coverage
if: ${{ !cancelled() }}
run: |
{
echo '## Tests'
echo
echo '```'
grep -E '^(Test Suites|Tests|Snapshots|Time):' "$RUNNER_TEMP/tests.txt"
echo '```'
echo
echo '## Test coverage'
echo
echo '```'
awk '/^-+\|/ { f = 1 } /^Test Suites:/ { f = 0 } f' "$RUNNER_TEMP/tests.txt"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"