From 033a2ced84143c7134d5bf9cfed86402c2084db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kautler?= Date: Tue, 11 Apr 2023 17:26:51 +0200 Subject: [PATCH] Improve Codecov settings Fail the CI build if the Codecov uploading failed. Show more detailed information in the Codecov comment. Do not update the Codecov comment 15 times, but post it after all 16 reports were uploaded. Ignore dates in coverage reports to not get "upload expired" because the report was taken from remote build cache. --- .github/workflows/branches-and-prs.main.kts | 4 +++- .github/workflows/branches-and-prs.yml | 2 ++ .github/workflows/release.main.kts | 4 +++- .github/workflows/release.yml | 2 ++ codecov.yml | 6 ++++++ 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/branches-and-prs.main.kts b/.github/workflows/branches-and-prs.main.kts index 849dac6f68..0c3cb0608e 100755 --- a/.github/workflows/branches-and-prs.main.kts +++ b/.github/workflows/branches-and-prs.main.kts @@ -104,7 +104,9 @@ workflow( ) uses( name = "Upload to Codecov.io", - action = CodecovAction() + action = CodecovAction( + failCiIfError = true + ) ) } } diff --git a/.github/workflows/branches-and-prs.yml b/.github/workflows/branches-and-prs.yml index 251d67e7e5..b18faad7cc 100644 --- a/.github/workflows/branches-and-prs.yml +++ b/.github/workflows/branches-and-prs.yml @@ -107,3 +107,5 @@ jobs: - id: 'step-3' name: 'Upload to Codecov.io' uses: 'codecov/codecov-action@v4' + with: + fail_ci_if_error: 'true' diff --git a/.github/workflows/release.main.kts b/.github/workflows/release.main.kts index d3e052a9bf..94c4b200e9 100755 --- a/.github/workflows/release.main.kts +++ b/.github/workflows/release.main.kts @@ -87,7 +87,9 @@ workflow( ) uses( name = "Upload to Codecov.io", - action = CodecovAction() + action = CodecovAction( + failCiIfError = true + ) ) } val releaseSpock = job( diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5b41b49f0..4c0a4c8ef3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,6 +95,8 @@ jobs: - id: 'step-4' name: 'Upload to Codecov.io' uses: 'codecov/codecov-action@v4' + with: + fail_ci_if_error: 'true' release-spock: name: 'Release Spock' runs-on: '${{ matrix.os }}' diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..250c97597b --- /dev/null +++ b/codecov.yml @@ -0,0 +1,6 @@ +codecov: + max_report_age: off + +comment: + layout: "reach, diff, flags, files" + after_n_builds: 16