Enhance Codecov upload conditions#1490
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the GitHub Actions coverage workflow to make Codecov uploads run more consistently on pull requests and to tighten failure behavior when an upload fails.
Changes:
- Run the Codecov upload step when either
HAS_CODECOV_TOKENis true or the workflow is triggered bypull_request. - Configure the Codecov action to explicitly upload
coverage.xmland to fail CI if the upload errors. - Only print the “skip Codecov upload” message when the token is missing and the event is not a pull request.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1490 +/- ##
=======================================
Coverage 99.90% 99.90%
=======================================
Files 6 6
Lines 1086 1086
Branches 146 146
=======================================
Hits 1085 1085
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request updates the Codecov upload step in the GitHub Actions workflow to improve coverage reporting reliability, especially for pull requests. The main change ensures that coverage reports are uploaded for all pull requests, even if the
CODECOV_TOKENis missing, and adds stricter error handling for the upload step.CI/CD workflow improvements:
.github/workflows/tests.yamlnow runs if eitherHAS_CODECOV_TOKENistrueor the workflow is triggered by a pull request, ensuring coverage reports are uploaded for all PRs.fail_ci_if_error: true), and explicitly specifies the coverage file to upload (files: coverage.xml).