From d64332c61202645857ee6a2bf42ba7343265c0b4 Mon Sep 17 00:00:00 2001 From: Duncan McPherson Date: Sat, 16 Dec 2023 21:00:38 -0700 Subject: [PATCH 1/4] added initial readme and more coverage support --- .github/workflows/test.yml | 4 ++++ .npmrc | 1 - package.json | 2 +- readme.md | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 readme.md diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6b52edc..e5ebb39 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,10 @@ jobs: with: files: | test-results/junit.xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} base_branch_coverage: runs-on: ubuntu-latest steps: diff --git a/.npmrc b/.npmrc index 48656cb..e69de29 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +0,0 @@ -//registry.npmjs.org/:_authToken=${NPM_DEPLOY} \ No newline at end of file diff --git a/package.json b/package.json index 09caf29..86f5d49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ez-budgets/test-utils", - "version": "1.0.0", + "version": "1.0.1", "description": "Packaging meant to help with the process of writing Jest tests", "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..44397f3 --- /dev/null +++ b/readme.md @@ -0,0 +1,4 @@ +# Test Utils + +![Tests](https://github.com/duncanmcpherson/test-utils/actions/workflows/test.yml/badge.svg) +![Build](https://github.com/duncanmcpherson/test-utils/actions/workflows/merge.yml/badge.svg) \ No newline at end of file From 8a183e80b9348a89fbb34c3f7302411afd8dd0bd Mon Sep 17 00:00:00 2001 From: Duncan McPherson Date: Sat, 16 Dec 2023 21:00:51 -0700 Subject: [PATCH 2/4] todo comment --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5ebb39..f492e2b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,6 +47,7 @@ jobs: with: name: ref-lcov.info path: ./test-results/coverage/lcov.info +# TODO: evaluate the necessity/value of this bit checks: runs-on: ubuntu-latest needs: base_branch_coverage From acfb3681d988b6e0fe992bf7bcd6b6d49023e102 Mon Sep 17 00:00:00 2001 From: Duncan McPherson Date: Sat, 16 Dec 2023 21:04:42 -0700 Subject: [PATCH 3/4] add coverage badge --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 44397f3..9f17852 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,5 @@ # Test Utils ![Tests](https://github.com/duncanmcpherson/test-utils/actions/workflows/test.yml/badge.svg) -![Build](https://github.com/duncanmcpherson/test-utils/actions/workflows/merge.yml/badge.svg) \ No newline at end of file +![Build](https://github.com/duncanmcpherson/test-utils/actions/workflows/merge.yml/badge.svg) +[![codecov](https://codecov.io/gh/DuncanMcPherson/test-utils/graph/badge.svg?token=B7FL6TPHO8)](https://codecov.io/gh/DuncanMcPherson/test-utils) \ No newline at end of file From 937725796add68b92dfcd96fa433efa1d95c8ae6 Mon Sep 17 00:00:00 2001 From: Duncan McPherson Date: Sat, 16 Dec 2023 21:06:12 -0700 Subject: [PATCH 4/4] remove old coverage --- .github/workflows/test.yml | 52 +------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f492e2b..80f2b7b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,54 +26,4 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - base_branch_coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.base_ref }} - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{runner.os }}-build-${{ hashFiles('**/package-lock.json') }} - - run: npm install - - run: npm run test - - name: Upload code coverage for master - if: always() - uses: actions/upload-artifact@v3 - with: - name: ref-lcov.info - path: ./test-results/coverage/lcov.info -# TODO: evaluate the necessity/value of this bit - checks: - runs-on: ubuntu-latest - needs: base_branch_coverage - if: always() - steps: - - uses: actions/checkout@v3 - - name: Download base coverage - uses: actions/download-artifact@v3 - with: - name: ref-lcov.info - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{runner.os }}-build-${{ hashFiles('**/package-lock.json') }} - - run: npm install - - run: npm run test - continue-on-error: true - - name: Generate code coverage - if: always() - id: code-coverage - uses: barecheck/code-coverage-action@v1 - with: - barecheck-github-app-token: ${{ secrets.BARECHECK_GITHUB_APP_TOKEN }} - lcov-file: "./test-results/coverage/lcov.info" - base-lcov-file: "./lcov.info" - send-summary-comment: true - show-annotations: "warning" \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file