From 325bfbf7a9e929b9f787da94da0f015e1cebc600 Mon Sep 17 00:00:00 2001 From: Brad Trott Date: Sun, 6 Jun 2021 07:26:03 -0400 Subject: [PATCH 1/7] only run node v12 for ci --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 3a886ef..46bab5c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x, 15.x] + node-version: [12.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From 503ad7f3c3073be3049e05e8f80e121a641b5c7e Mon Sep 17 00:00:00 2001 From: Brad Trott Date: Sun, 6 Jun 2021 07:30:42 -0400 Subject: [PATCH 2/7] fix coverage config --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 46bab5c..410c5da 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -33,4 +33,4 @@ jobs: uses: EnricoMi/publish-unit-test-result-action/composite@v1 if: always() with: - files: test-results/**/*.xml + files: coverage/**/*.xml From e45920f1340cfadc7c17ee612d2696170334cc13 Mon Sep 17 00:00:00 2001 From: Brad Trott Date: Sun, 6 Jun 2021 07:38:49 -0400 Subject: [PATCH 3/7] trying new plugin for coverage report --- .github/workflows/node.js.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 410c5da..689db2f 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: macos-latest + runs-on: ubuntu-latest strategy: matrix: @@ -28,9 +28,6 @@ jobs: - run: npm ci - run: npm run build --if-present - run: npm test - - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action/composite@v1 - if: always() - with: - files: coverage/**/*.xml + - name: coverage + uses: artiomtr/jest-coverage-report-action@v1.3 + From d419c07d5cf435d1b0f0475a538d51887cf7d6e0 Mon Sep 17 00:00:00 2001 From: Brad Trott Date: Sun, 6 Jun 2021 07:41:33 -0400 Subject: [PATCH 4/7] add token for commenting --- .github/workflows/node.js.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 689db2f..e344dcb 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -30,4 +30,6 @@ jobs: - run: npm test - name: coverage uses: artiomtr/jest-coverage-report-action@v1.3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} From 116121d9916e58f0b762141652675463536f87c6 Mon Sep 17 00:00:00 2001 From: Brad Trott Date: Sun, 6 Jun 2021 07:47:13 -0400 Subject: [PATCH 5/7] update token name --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index e344dcb..06f8253 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -31,5 +31,5 @@ jobs: - name: coverage uses: artiomtr/jest-coverage-report-action@v1.3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.COVERAGE_REPORT_TOKEN }} From 7e57a398335bd5725cf449fb2f697e9bde17c7cb Mon Sep 17 00:00:00 2001 From: Brad Trott Date: Sun, 6 Jun 2021 21:22:18 -0400 Subject: [PATCH 6/7] remove unnecessary build step --- .github/workflows/node.js.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 06f8253..936dccf 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -27,9 +27,8 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run build --if-present - - run: npm test + #- run: npm test (runs in the coverage step) - name: coverage uses: artiomtr/jest-coverage-report-action@v1.3 with: github_token: ${{ secrets.COVERAGE_REPORT_TOKEN }} - From 7dcbd8c4bc05c427426bf2538c4870ed9c9a08ab Mon Sep 17 00:00:00 2001 From: Brad Trott Date: Sun, 6 Jun 2021 21:34:16 -0400 Subject: [PATCH 7/7] Set test thresholds for breaking builds, and always allow coverage to run --- jest.config.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 1998b1c..b7c1bf4 100644 --- a/jest.config.js +++ b/jest.config.js @@ -40,7 +40,14 @@ module.exports = { // ], // An object that configures minimum threshold enforcement for coverage results - // coverageThreshold: undefined, + coverageThreshold: { + global: { + branches: 90, + functions: 90, + lines: 90, + statements: 90 + } + }, // A path to a custom dependency extractor // dependencyExtractor: undefined,