-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.03 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Coverage
on:
pull_request:
branches:
- 'main'
env:
CI: true
jobs:
coverage:
runs-on: ubuntu-latest
name: Coverage
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Calculate Code Coverage
run: npm run ci:coverage
- name: Create Coverage Report for base branch
run: |
mv coverage/lcov.info coverage/lcov_head.info
git fetch
git checkout origin/${{ github.event.pull_request.base.ref }}
npm ci --ignore-scripts && npm run ci:coverage
- name: Post Coverage Report
uses: checkdigit/github-actions/coverage-reporter@main
with:
lcov-file: 'coverage/lcov_head.info'
lcov-base: 'coverage/lcov.info'
delete-old-comments: true