-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.31 KB
/
test.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
49
50
51
52
53
54
55
56
name: Run Tests and Generate Reports
on:
push:
branches:
- main
- tests
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Run Tests with Coverage
run: npm run coverage
- name: Upload Test Reports
uses: actions/upload-artifact@v4
with:
name: test-reports
path: |
coverage/
test-results/
retention-days: 7
- name: Generate Test Summary
run: |
mkdir -p test-results
echo "## Test and Coverage Report" > test-results/summary.md
echo "\`\`\`" >> test-results/summary.md
npx vitest run --coverage >> test-results/summary.md
echo "\`\`\`" >> test-results/summary.md
- name: Upload Test Summary
uses: actions/upload-artifact@v4
with:
name: test-summary
path: test-results/
retention-days: 7
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json