Skip to content

Commit

Permalink
ci(cli): enable coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
endersonmaia committed Oct 15, 2024
1 parent 7204625 commit 1bb5a25
Show file tree
Hide file tree
Showing 4 changed files with 6,889 additions and 9,122 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ concurrency:
permissions:
contents: read
packages: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -51,6 +52,10 @@ jobs:
working-directory: ./apps/cli
run: pnpm test run

- name: "Report Coverage"
if: always()
uses: davelosert/vitest-coverage-report-action@v2

- name: Build
run: pnpm build --filter @cartesi/cli

Expand Down
5 changes: 3 additions & 2 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@types/prompts": "^2.4.9",
"@types/semver": "^7.5.8",
"@types/tmp": "^0.2.6",
"@vitest/coverage-istanbul": "^2.1.3",
"@wagmi/cli": "^2.1.16",
"copyfiles": "^2.4.1",
"eslint": "^8.57.0",
Expand All @@ -66,7 +67,7 @@
"tsconfig": "workspace:*",
"tslib": "^2.7.0",
"typescript": "^5.6.2",
"vitest": "^2.1.1"
"vitest": "^2.1.3"
},
"oclif": {
"bin": "cartesi",
Expand All @@ -91,7 +92,7 @@
"postpack": "rimraf oclif.manifest.json",
"posttest": "pnpm lint",
"prepack": "pnpm build && oclif manifest",
"test": "vitest"
"test": "vitest --coverage.enabled true"
},
"engines": {
"node": ">=18.0.0"
Expand Down
11 changes: 11 additions & 0 deletions apps/cli/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
coverage: {
provider: "istanbul",
reporter: ["text", "json-summary", "json"],
reportOnFailure: true,
},
},
});
Loading

0 comments on commit 1bb5a25

Please sign in to comment.