From 030610922264c760758e0daace4109497333a2c7 Mon Sep 17 00:00:00 2001 From: Jordan Shatford Date: Tue, 19 Mar 2024 11:49:27 +1100 Subject: [PATCH 1/3] feat: upload coverage to codecov --- .github/workflows/coverage.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..5df4ec351 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,32 @@ +name: Coverage + +on: + push: + branches: + - main + +jobs: + upload: + name: Upload + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Run test coverage + run: npm run test:coverage + + - name: Upload code coverage to codecov.io + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage + flags: unittests + fail_ci_if_error: true From 11e5963a9977c68d9208a259ff4ddce54597b465 Mon Sep 17 00:00:00 2001 From: Jordan Shatford Date: Tue, 19 Mar 2024 11:51:44 +1100 Subject: [PATCH 2/3] chore: upload coverage for pull requests --- .github/workflows/coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5df4ec351..3a6e61ac6 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -4,6 +4,7 @@ on: push: branches: - main + pull_request: jobs: upload: From 79adecd89f7169911c95ff80a6c35f7603059528 Mon Sep 17 00:00:00 2001 From: Jordan Shatford Date: Tue, 19 Mar 2024 11:55:27 +1100 Subject: [PATCH 3/3] chore: build library before getting test coverage --- .github/workflows/coverage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3a6e61ac6..36f5880ac 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,6 +21,9 @@ jobs: - name: Install dependencies run: npm install + - name: Build library + run: npm run build + - name: Run test coverage run: npm run test:coverage