Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 3f5a643

Browse files
committed
ci(coverage): upload Vitest report to Codecov
1 parent 7cebfa6 commit 3f5a643

File tree

4 files changed

+58
-9
lines changed

4 files changed

+58
-9
lines changed

.github/workflows/node.js.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,19 @@ jobs:
4646
node-version: ${{ matrix.node-version }}
4747
cache: pnpm
4848
- name: Install dependencies
49-
run: |
50-
pnpm install
51-
pnpm add -g codecov
49+
run: pnpm install
5250
- name: Build
53-
run: pnpm run build
51+
run: |
52+
pnpm run build
53+
pnpm -r run build
5454
- name: Lint with ESLint
5555
run: pnpm run lint
5656
- name: Test with Jest
5757
run: |
5858
pnpm run test --ci --coverage
59-
cd admin && pnpm run test:unit && cd ..
60-
codecov
59+
cd admin && pnpm run test:unit --coverage && cd ..
60+
- name: Codecov
61+
uses: codecov/codecov-action@v2
62+
with:
63+
fail_ci_if_error: true
64+
verbose: true

admin/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@vue/eslint-config-typescript": "^10.0.0",
2828
"@vue/test-utils": "^2.0.0",
2929
"@vue/tsconfig": "^0.1.3",
30+
"c8": "^7.11.3",
3031
"eslint": "^8.17.0",
3132
"eslint-plugin-vue": "^8.7.1",
3233
"jsdom": "^19.0.0",

admin/vite.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { fileURLToPath, URL } from "url";
22

3-
import { defineConfig } from "vite";
3+
import { defineConfig } from "vitest/config";
44
import vue from "@vitejs/plugin-vue";
55

66
// https://vitejs.dev/config/
@@ -11,4 +11,9 @@ export default defineConfig({
1111
"@": fileURLToPath(new URL("./src", import.meta.url)),
1212
},
1313
},
14+
test: {
15+
coverage: {
16+
reporter: ["text", "json", "html"],
17+
},
18+
},
1419
});

pnpm-lock.yaml

Lines changed: 41 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)