Skip to content

Commit

Permalink
chore: add code coverage to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Apr 19, 2024
1 parent d265806 commit dda5119
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@ jobs:
run: deno lint

- name: test
run: deno task test
run: deno task test:coverage

- name: generate lcov
run: deno task coverage --lcov --output=cov.lcov

- name: upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: oakserver/commons
files: ./cov.lcov
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cov
cov.lcov
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
[![jsr.io/@oak/commons score](https://jsr.io/badges/@oak/commons/score)](https://jsr.io/@oak/commons)
[![deno.land/x/oak_commons](https://deno.land/badge/oak_commons/version)](https://deno.land/x/oak_commons)

[![ci](https://github.com/oakserver/commons/workflows/ci/badge.svg)](https://github.com/oakserver/commons)
[![codecov](https://codecov.io/gh/oakserver/commons/graph/badge.svg?token=zImXfOXhO2)](https://codecov.io/gh/oakserver/commons)

A set of APIs that are common to HTTP/HTTPS servers.

> [!NOTE]
Expand Down
4 changes: 3 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
},
"tasks": {
"bench": "deno bench --allow-read",
"test": "deno test --allow-read"
"coverage": "deno coverage --output=cov.lcov --lcov ./cov",
"test": "deno test --allow-read",
"test:coverage": "deno test --allow-read --coverage=./cov"
},
"lock": false,
"fmt": {
Expand Down

0 comments on commit dda5119

Please sign in to comment.