Skip to content

Commit

Permalink
ci(coverage): upload Vitest report to Codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
wxh06 committed Jun 13, 2022
1 parent 7cebfa6 commit c2dce98
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 10 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 17.x]
node-version: [16.x, 17.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -46,15 +46,18 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: |
pnpm install
pnpm add -g codecov
run: pnpm install
- name: Build
run: pnpm run build
run: |
pnpm run build
pnpm -r run build
- name: Lint with ESLint
run: pnpm run lint
- name: Test with Jest
run: |
pnpm run test --ci --coverage
cd admin && pnpm run test:unit && cd ..
codecov
cd admin && pnpm run test:unit --coverage && cd ..
- name: Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
1 change: 1 addition & 0 deletions admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@vue/eslint-config-typescript": "^10.0.0",
"@vue/test-utils": "^2.0.0",
"@vue/tsconfig": "^0.1.3",
"c8": "^7.11.3",
"eslint": "^8.17.0",
"eslint-plugin-vue": "^8.7.1",
"jsdom": "^19.0.0",
Expand Down
7 changes: 6 additions & 1 deletion admin/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fileURLToPath, URL } from "url";

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

// https://vitejs.dev/config/
Expand All @@ -11,4 +11,9 @@ export default defineConfig({
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
test: {
coverage: {
reporter: ["text", "json", "html"],
},
},
});
43 changes: 41 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c2dce98

Please sign in to comment.