Skip to content

Commit 3afe293

Browse files
committed
ci: add coverage
1 parent 7595187 commit 3afe293

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,17 @@ jobs:
4343
cache: pnpm
4444

4545
- run: pnpm install --frozen-lockfile
46-
- run: pnpm run test
4746

48-
- uses: codecov/codecov-action@v4
47+
- name: Tests with coverage
48+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == 'lts/*' }}
49+
run: pnpm test -- --coverage
50+
51+
- name: Tests
52+
if: ${{ matrix.os != 'ubuntu-latest' || matrix.node != 'lts/*' }}
53+
run: pnpm test
54+
55+
- name: Upload coverage to Codecov
56+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == 'lts/*' }}
57+
uses: codecov/codecov-action@v4
4958
with:
5059
token: ${{ secrets.CODECOV_TOKEN }}

vitest.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ export default defineConfig({
1717
test: {
1818
setupFiles: ['./tests/router-mock.ts'],
1919
// open: false,
20+
coverage: {
21+
include: ['src/**/*.ts'],
22+
exclude: ['src/**/*.d.ts', 'src/**/*.test-d.ts', 'src/**/*.spec.ts'],
23+
},
2024
typecheck: {
2125
enabled: true,
2226
checker: 'vue-tsc',

0 commit comments

Comments
 (0)