Skip to content

Commit

Permalink
Improve Codecov settings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vampire committed Aug 8, 2024
1 parent 1520e8d commit 033a2ce
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/branches-and-prs.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ workflow(
)
uses(
name = "Upload to Codecov.io",
action = CodecovAction()
action = CodecovAction(
failCiIfError = true
)
)
}
}
2 changes: 2 additions & 0 deletions .github/workflows/branches-and-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,5 @@ jobs:
- id: 'step-3'
name: 'Upload to Codecov.io'
uses: 'codecov/codecov-action@v4'
with:
fail_ci_if_error: 'true'
4 changes: 3 additions & 1 deletion .github/workflows/release.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ workflow(
)
uses(
name = "Upload to Codecov.io",
action = CodecovAction()
action = CodecovAction(
failCiIfError = true
)
)
}
val releaseSpock = job(
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
codecov:
max_report_age: off

comment:
layout: "reach, diff, flags, files"
after_n_builds: 16

0 comments on commit 033a2ce

Please sign in to comment.