Skip to content

Commit

Permalink
ci(test): Upload the test result to Codecov (#103)
Browse files Browse the repository at this point in the history
It can comment on the reason why tests failed.
  • Loading branch information
5ouma authored Nov 7, 2024
1 parent 271ee9e commit 82155c8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,19 @@ jobs:
uses: ./.github/actions/setup-deno-with-cache

- name: 🧪 Run Tests
run: deno task cov
run: deno task test:ci

- name: ☂️ Upload Coverage
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: ☂️ Upload Test Results
if: ${{ !cancelled() }}
uses: codecov/test-results-action@9739113ad922ea0a9abb4b2c0f8bf6a4aa8ef820 # v1.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}

dry-run-publish:
name: 📦 Dry Run Publish
runs-on: Ubuntu-Latest
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.env
/coverage.lcov
/coverage
.env
coverage.lcov
coverage/
junit.xml
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"start": "deno task serve src/server.ts",
"dev": "deno task serve --watch src/server.ts",
"test": "deno test --doc -EN='api.github.com' --parallel --shuffle",
"cov": "deno task test --coverage && deno coverage --lcov > coverage.lcov"
"test:ci": "deno task test --coverage --junit-path='junit.xml' && deno coverage --lcov > coverage.lcov"
},
"imports": {
"@hono/hono": "jsr:@hono/[email protected]",
Expand Down

0 comments on commit 82155c8

Please sign in to comment.