Skip to content

Commit 96befca

Browse files
committed
feat: adding coverage check
1 parent 9576ce2 commit 96befca

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: PR Coverage Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
pull-requests: write
13+
checks: write
14+
contents: read
15+
16+
jobs:
17+
coverage-check:
18+
runs-on: ubuntu-latest
19+
# Skip job if PR has 'skip coverage check' label
20+
if: contains(github.event.pull_request.labels.*.name, 'skip coverage check') == false
21+
22+
steps:
23+
- name: ⚙️ Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: ⚙️ Install dependencies
27+
uses: ./.github/workflows/install-pnpm
28+
29+
- name: 🧪 Run tests with coverage
30+
run: pnpm test:coverage
31+
32+
- name: 📊 Report coverage
33+
if: always()
34+
uses: davelosert/vitest-coverage-report-action@v2
35+
with:
36+
json-summary-path: ./.coverage/coverage-summary.json
37+
vite-config-path: ./vitest.config.ts
38+
working-directory: ./
39+

vitest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ const config: UserConfigFnPromise = async (options) => {
6868
thresholds: {
6969
branches: 25,
7070
functions: 10,
71-
lines: 10,
72-
statements: 10,
71+
lines: 30,
72+
statements: 30,
7373
},
7474
reporter: 'json-summary',
7575
},

0 commit comments

Comments
 (0)