From ac49929d2e9311a581b6a3dfb6a2a48ac9615bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bergstr=C3=B6m?= Date: Wed, 17 Jul 2024 14:33:49 +0100 Subject: [PATCH] feat: track code coverage with codecov --- .github/codecov.yml | 8 ++++++++ .github/workflows/test-bun.yml | 12 +++++++++++- .gitignore | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..b46f5ca --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,8 @@ +comment: false + +coverage: + status: + project: + default: + target: 100% + patch: off diff --git a/.github/workflows/test-bun.yml b/.github/workflows/test-bun.yml index cc8046a..23c98ea 100644 --- a/.github/workflows/test-bun.yml +++ b/.github/workflows/test-bun.yml @@ -3,6 +3,9 @@ on: pull_request: paths: - "**/*.ts" + push: + branches: + - main jobs: bun-test: @@ -15,4 +18,11 @@ jobs: - run: bun install - name: Run tests - run: bun test + run: bun test --coverage-reporter lcov + + - uses: codecov/codecov-action@v4.5.0 + with: + slug: Topsort/topsort.js + files: coverage.lcov + token: ${{ secrets.CODECOV_TOKEN }} + flags: unittest diff --git a/.gitignore b/.gitignore index b947077..ef229ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -node_modules/ +coverage/ dist/ +node_modules/