From 3f5c1fb60e119541ad2cfb53517f74755af07daa Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Wed, 8 May 2024 10:44:40 -0400 Subject: [PATCH 1/2] split out generating lcov file vs showing coverage in the terminal --- deno.jsonc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deno.jsonc b/deno.jsonc index d20a800..10967c7 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -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/code_coverage@0.2.0/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 } From 18ef568dc6d9d08ab5637b4e2ee90362b3aaca66 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Wed, 8 May 2024 10:57:13 -0400 Subject: [PATCH 2/2] Integrate with codecov. --- .github/maintainers_guide.md | 2 +- .github/workflows/deno-ci.yml | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 222237e..9115bdc 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -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. diff --git a/.github/workflows/deno-ci.yml b/.github/workflows/deno-ci.yml index 4547495..780473f 100644 --- a/.github/workflows/deno-ci.yml +++ b/.github/workflows/deno-ci.yml @@ -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 @@ -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 }}