Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codecov coverage report uploading #83

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ deno task test
To run the tests along with a coverage report:

```zsh
deno task coverage
deno task test:coverage
```

This command is also executed by GitHub Actions, the continuous integration service, for every Pull Request and branch.
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/deno-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Setup repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1
Expand All @@ -31,9 +31,10 @@ jobs:
run: deno task test

- name: Generate CodeCov-friendly coverage report
run: deno task coverage
run: deno task generate-lcov

- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v3.1.0
uses: codecov/codecov-action@v4
with:
file: ./lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
},
"tasks": {
"test": "deno fmt --check && deno lint && deno test --allow-read --allow-net --allow-write --allow-run --allow-env src",
"coverage": "rm -rf .coverage && deno test --reporter=dot --allow-read --allow-net --allow-write --allow-run --allow-env --coverage=.coverage src && deno coverage --exclude=fixtures --exclude=test --lcov --output=lcov.info .coverage && deno run --allow-read https://deno.land/x/[email protected]/cli.ts"
"generate-lcov": "rm -rf .coverage && deno test --reporter=dot --allow-read --allow-net --allow-write --allow-run --allow-env --coverage=.coverage src && deno coverage --exclude=fixtures --exclude=test --lcov --output=lcov.info .coverage",
"test:coverage":"deno task generate-lcov && deno coverage --exclude=fixtures --exclude=test .coverage"
},
"lock": false
}