forked from fastify/fastify
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.21 KB
/
coverage-nix.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
40
41
42
43
44
45
46
47
48
name: Code Coverage (*nix)
on:
workflow_call:
jobs:
check-coverage:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- uses: actions/cache@v3
id: check-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install
run: |
npm install --ignore-scripts
# We do not check coverage requirements here because the goal is to
# generate a report to upload as an artifact.
- name: Generate coverage report
run: |
npm run coverage:ci
- uses: actions/upload-artifact@v3
if: ${{ success() }}
with:
name: coverage-report-nix
path: ./coverage/lcov-report/
# Here, we verify the coverage thresholds so that this workflow can pass
# or fail and stop further workflows if this one fails.
- name: Verify coverage meets thresholds
run: |
npm run coverage:ci-check-coverage