From e8e5f6fc6ad272ffcffed1c6b7cc2c94ed76df79 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 20 Jun 2023 08:38:30 +1000 Subject: [PATCH] chore: setup Codecov (#266) * chore: setup Codecov * fix --- .github/codecov.yml | 9 +++++++++ .github/workflows/ci.yml | 9 +++++++++ .gitignore | 5 ++++- deno.json | 5 +++-- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 000000000..de10b6ff3 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,9 @@ +comment: false +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4f27e2d8..68deef226 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,3 +26,12 @@ jobs: - name: Check formatting, linting, license headers, types and run tests run: deno task ok + + - name: Create lcov file + run: deno task cov + + - name: Upload coverage + uses: codecov/codecov-action@v3 + with: + name: ${{ matrix.os }} + files: cov.lcov \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2eea525d8..b45931ebc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -.env \ No newline at end of file +.env +*.DS_Store +cov/ +cov.lcov \ No newline at end of file diff --git a/deno.json b/deno.json index 4e772a478..9e7834587 100644 --- a/deno.json +++ b/deno.json @@ -6,9 +6,10 @@ "db:seed": "deno run --allow-read --allow-env --allow-net --unstable tools/seed_submissions.ts", "db:reset": "deno run --allow-read --allow-env --unstable tools/reset_kv.ts", "start": "deno run --unstable -A --watch=static/,routes/ dev.ts", - "test": "deno test -A --unstable", + "test": "deno test -A --unstable --coverage=./cov", "check:license": "deno run --allow-read --allow-write tools/check_license.ts", - "ok": "deno fmt --check && deno lint && deno task check:license --check && deno check main.ts && deno task test" + "ok": "deno fmt --check && deno lint && deno task check:license --check && deno check main.ts && deno task test", + "cov": "deno coverage ./cov/ --lcov --exclude='test.ts' > cov.lcov" }, "importMap": "./import_map.json", "compilerOptions": {