From 2c52550bb1f7993aebf4d9b57abb1af5cebde784 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 17 Dec 2023 18:07:02 +0100 Subject: [PATCH 1/6] Configure Codecov to track breakage and compatibility coverage --- .github/codecov.yml | 12 ++++++++++++ .github/workflows/checks.yml | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/codecov.yml b/.github/codecov.yml index d18bf9bb4..5c5af11f6 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -19,6 +19,18 @@ comment: require_head: yes flags: + breakage: + carryforward: true + paths: + - src/ + - index.js + - testing.js + compatibility: + carryforward: true + paths: + - src/ + - index.js + - testing.js e2e-MacOS: carryforward: true paths: diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e22a4f62e..6a2c25bd2 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -251,6 +251,12 @@ jobs: run: npm clean-install - name: Run breakage tests run: npm run coverage:breakage + - name: Upload coverage to Codecov + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 + if: ${{ always() }} + with: + file: ./_reports/coverage/breakage/lcov.info + flags: breakage test-compatibility: name: Compatibility runs-on: ubuntu-22.04 @@ -298,6 +304,12 @@ jobs: name: index-common-js - name: Run compatibility tests run: npm run coverage:compat --ignore-scripts + - name: Upload coverage to Codecov + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 + if: ${{ matrix.node-version == '20.0.0' }} + with: + file: ./_reports/coverage/compat/lcov.info + flags: compatibility test-e2e: name: End-to-end (${{ matrix.name }}) runs-on: ${{ matrix.os }} From 151ff0608ea241fba40a18eadf9e8a7a99aaf501 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 17 Dec 2023 18:24:19 +0100 Subject: [PATCH 2/6] Allow Codecov endpoints for breakage and compatibility jobs --- .github/workflows/checks.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6a2c25bd2..623794d27 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -235,11 +235,13 @@ jobs: actions-results-receiver-production.githubapp.com:443 api.github.com:443 artifactcache.actions.githubusercontent.com:443 + codecov.io:443 github.com:443 gitlab.com:443 nodejs.org:443 objects.githubusercontent.com:443 registry.npmjs.org:443 + uploader.codecov.io:443 - name: Checkout repository uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Install Node.js @@ -282,11 +284,13 @@ jobs: actions-results-receiver-production.githubapp.com:443 api.github.com:443 artifactcache.actions.githubusercontent.com:443 + codecov.io:443 github.com:443 gitlab.com:443 nodejs.org:443 objects.githubusercontent.com:443 registry.npmjs.org:443 + uploader.codecov.io:443 - name: Checkout repository uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Install Node.js From c39cfe6e5785a2e5857b5bde5c1f115fbfb50062 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Wed, 20 Dec 2023 21:41:00 +0100 Subject: [PATCH 3/6] Adjust coverage targets for different flags --- .github/codecov.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 5c5af11f6..b1b40734a 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -7,9 +7,25 @@ coverage: status: project: default: false - source: - paths: - - src/ + target: 95% + flags: + - e2e-MacOS + - e2e-Ubuntu + - e2e-Windows + - integration-MacOS + - integration-Ubuntu + - integration-Windows + strict: + default: false + target: 100% + flags: + - unit + relaxed: + default: false + target: 10% + flags: + - breakage + - compatibility comment: layout: diff, flags, files From 055537b1efae85e4eff4eadc0a49db291698b637 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Wed, 20 Dec 2023 21:45:03 +0100 Subject: [PATCH 4/6] Adjust configuration --- .github/codecov.yml | 40 ++++++++++++++++++------------------ .github/workflows/checks.yml | 8 ++++---- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 5f98cc7fd..6948319c9 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -6,26 +6,26 @@ coverage: range: 80...100 status: project: - default: false - target: 95% - flags: - - e2e-MacOS - - e2e-Ubuntu - - e2e-Windows - - integration-MacOS - - integration-Ubuntu - - integration-Windows - strict: - default: false - target: 100% - flags: - - unit - relaxed: - default: false - target: 10% - flags: - - breakage - - compatibility + default: + target: 95% + flags: + - e2e-MacOS + - e2e-Ubuntu + - e2e-Windows + - integration-MacOS + - integration-Ubuntu + - integration-Windows + relaxed: + default: false + target: 10% + flags: + - breakage + - compatibility + strict: + default: false + target: 100% + flags: + - unit comment: layout: diff, flags, files diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 27626208a..7557a4d1c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -255,7 +255,7 @@ jobs: run: npm run coverage:breakage - name: Upload coverage to Codecov uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - if: ${{ always() }} + if: ${{ failure() || success() }} with: file: ./_reports/coverage/breakage/lcov.info flags: breakage @@ -367,7 +367,7 @@ jobs: run: npm run coverage:e2e - name: Upload coverage to Codecov uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - if: ${{ always() }} + if: ${{ failure() || success() }} with: file: ./_reports/coverage/e2e/lcov.info flags: e2e-${{ matrix.name }} @@ -425,7 +425,7 @@ jobs: run: npm run coverage:integration - name: Upload coverage to Codecov uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - if: ${{ always() }} + if: ${{ failure() || success() }} with: file: ./_reports/coverage/integration/lcov.info flags: integration-${{ matrix.name }} @@ -560,7 +560,7 @@ jobs: run: npm run coverage:unit - name: Upload coverage to Codecov uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - if: ${{ always() }} + if: ${{ failure() || success() }} with: file: ./_reports/coverage/unit/lcov.info flags: unit From c4c5e21f42077388d5eb7c8a4571506feeac0868 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Wed, 20 Dec 2023 21:47:50 +0100 Subject: [PATCH 5/6] Remove extraneous fields --- .github/codecov.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 6948319c9..e06f98bd7 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -16,13 +16,11 @@ coverage: - integration-Ubuntu - integration-Windows relaxed: - default: false target: 10% flags: - breakage - compatibility strict: - default: false target: 100% flags: - unit From d19573471263b86f245f4aff41056c00b37d2476 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Wed, 20 Dec 2023 22:10:44 +0100 Subject: [PATCH 6/6] Add missing allowed API that allows for uploading coverage to Codecov --- .github/workflows/checks.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7557a4d1c..13999bc85 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -241,6 +241,7 @@ jobs: nodejs.org:443 objects.githubusercontent.com:443 registry.npmjs.org:443 + storage.googleapis.com:443 uploader.codecov.io:443 - name: Checkout repository uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 @@ -290,6 +291,7 @@ jobs: nodejs.org:443 objects.githubusercontent.com:443 registry.npmjs.org:443 + storage.googleapis.com:443 uploader.codecov.io:443 - name: Checkout repository uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0