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 authored and tuler committed Oct 17, 2024
1 parent c20246e commit 43e18a3
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 53 deletions.
11 changes: 9 additions & 2 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 All @@ -47,9 +48,15 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Test
- name: Test / Coverage
working-directory: ./apps/cli
run: pnpm run test
run: pnpm run test:coverage

- name: "Report Coverage"
if: always()
uses: davelosert/vitest-coverage-report-action@v2
with:
working-directory: ./apps/cli

- name: Build
run: pnpm build --filter @cartesi/cli
Expand Down
4 changes: 3 additions & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,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 Down Expand Up @@ -90,7 +91,8 @@
"postpack": "rimraf oclif.manifest.json",
"posttest": "pnpm lint",
"prepack": "pnpm build && oclif manifest",
"test": "vitest"
"test": "vitest",
"test:coverage": "vitest --coverage.enabled true"
},
"engines": {
"node": ">=18.0.0"
Expand Down
12 changes: 12 additions & 0 deletions apps/cli/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from "vitest/config";

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

0 comments on commit 43e18a3

Please sign in to comment.