From dda511929ab1ed38a3224095e380d4623afc10bc Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Fri, 19 Apr 2024 18:41:05 +1000 Subject: [PATCH] chore: add code coverage to ci --- .github/workflows/ci.yml | 12 +++++++++++- .gitignore | 2 ++ README.md | 3 +++ deno.json | 4 +++- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71b876f..70ddce5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45e794b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +cov +cov.lcov \ No newline at end of file diff --git a/README.md b/README.md index 380dba8..2d67921 100644 --- a/README.md +++ b/README.md @@ -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] diff --git a/deno.json b/deno.json index ae9ad40..425a692 100644 --- a/deno.json +++ b/deno.json @@ -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": {