From 90cd7f6979de6b200ea67f444d20c97eaeb8ca0f Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Wed, 8 May 2024 14:59:38 +0000 Subject: [PATCH] Add codecov coverage report uploading (#83) * split out generating lcov file vs showing coverage in the terminal * Integrate with codecov. --- .github/maintainers_guide.md | 2 +- .github/workflows/deno-ci.yml | 7 ++++--- deno.jsonc | 3 ++- 3 files changed, 7 insertions(+), 5 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 }} 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 }