-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 923 Bytes
/
test.yml
File metadata and controls
37 lines (33 loc) · 923 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
37
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
pull-requests: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Run tests with coverage
run: |
echo "## 🧪 Vitest Coverage" > coverage_output.txt
echo '```' >> coverage_output.txt
NO_COLOR=1 pnpm test:coverage 2>&1 | tee -a coverage_output.txt
echo '```' >> coverage_output.txt
- name: Post coverage comment
if: github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: vitest-coverage
path: coverage_output.txt