Skip to content

Enhance Codecov upload conditions#1490

Merged
liudger merged 2 commits into
mainfrom
fix-code-coverage
May 21, 2026
Merged

Enhance Codecov upload conditions#1490
liudger merged 2 commits into
mainfrom
fix-code-coverage

Conversation

@liudger
Copy link
Copy Markdown
Owner

@liudger liudger commented May 21, 2026

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_TOKEN is missing, and adds stricter error handling for the upload step.

CI/CD workflow improvements:

  • The Codecov upload step in .github/workflows/tests.yaml now runs if either HAS_CODECOV_TOKEN is true or the workflow is triggered by a pull request, ensuring coverage reports are uploaded for all PRs.
  • The Codecov upload action is now configured to fail the CI if the upload encounters an error (fail_ci_if_error: true), and explicitly specifies the coverage file to upload (files: coverage.xml).
  • The skip message for Codecov upload is now only shown if the token is missing and the event is not a pull request, reducing unnecessary log noise.

Copilot AI review requested due to automatic review settings May 21, 2026 07:22
@liudger liudger added the ci Work that improves the continue integration. label May 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_TOKEN is true or the workflow is triggered by pull_request.
  • Configure the Codecov action to explicitly upload coverage.xml and 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.

Comment thread .github/workflows/tests.yaml Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.90%. Comparing base (f58a27a) to head (16b5b21).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link
Copy Markdown

@liudger liudger merged commit 8aa0243 into main May 21, 2026
16 checks passed
@liudger liudger deleted the fix-code-coverage branch May 21, 2026 13:29
@github-actions github-actions Bot locked and limited conversation to collaborators May 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ci Work that improves the continue integration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants