Skip to content

Commit c4d5ec4

Browse files
committed
chore: update CI workflow
1 parent f5a69f1 commit c4d5ec4

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

.github/workflows/ci-vitest.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
name: CI - Run Vitest
22
on:
3-
push:
4-
branches: [main]
53
pull_request:
6-
branches: [main]
74
jobs:
85
test:
96
runs-on: ubuntu-latest
7+
permissions:
8+
contents: read
9+
pull-requests: write
1010
strategy:
1111
matrix:
1212
node-version: [20.x, 22.x, 24.x]
1313
steps:
1414
- uses: actions/checkout@v5
15-
- name: Use Node.js ${{ matrix.node-version }}
15+
- name: Install node ${{ matrix.node-version }}
1616
uses: actions/setup-node@v4
1717
with:
1818
node-version: ${{ matrix.node-version }}
19-
cache: "npm"
2019
- name: Install dependencies
2120
run: npm ci
22-
- name: Run vitests with coverage
23-
run: npm run test
21+
- name: Run tests
22+
run: npx vitest --coverage.enabled true
2423
- name: Code coverage summary
2524
uses: irongut/CodeCoverageSummary@v1.3.0
2625
with:
2726
filename: coverage/coverage.cobertura.xml
28-
- name: Add coverage pr comment
29-
uses: marocchino/sticky-pull-request-comment@v2
30-
if: github.event_name == 'pull_request'
31-
with:
32-
recreate: true
33-
path: code-coverage-result.md
27+
- name: "Report Coverage"
28+
if: always()
29+
uses: davelosert/vitest-coverage-report-action@v2

0 commit comments

Comments
 (0)