forked from MikuLXK/MoRanJiangHu
-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (33 loc) · 881 Bytes
/
Copy pathtest-coverage.yml
File metadata and controls
36 lines (33 loc) · 881 Bytes
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
name: test-coverage
on:
pull_request:
branches: [main, feat/optimization-v2]
push:
branches: [main, feat/optimization-v2]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
cache: npm
- run: npm ci
- name: Run unit tests
run: npm run test:unit
- name: Run coverage
run: npm run test:coverage
- name: Check coverage threshold
run: npx vitest run --coverage --coverage.thresholds.lines=12
continue-on-error: false
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v5
with:
name: coverage-report
path: coverage/
retention-days: 7