Skip to content

Conversation

@MatteoGentili24
Copy link
Collaborator

Summary

This PR introduces a new check to the CI pipeline to enforce 100% code coverage on all new pull requests.

Changes

I've modified the ci-build.yaml file to include a new step that fails the build if the total code coverage percentage is anything less than 100%.

Key updates in the workflow

Test with Coverage: The go test command now uses the -coverprofile=coverage.out flag to generate a coverage report. It also dynamically excludes specific files and directories from the coverage calculation based on a list in tests/config.yaml.

Check 100% coverage: A new step was added to parse the coverage.out file. It extracts the total coverage percentage and uses a shell script to enforce that the value is exactly 100.0. If it's not, the build will fail.

Upload coverage report: The workflow now uploads the coverage.out file to Codecov for detailed analysis.

Added to the ci-build.yaml file to make sure it looks for 100% coverage when a test job is run.
@MatteoGentili24 MatteoGentili24 linked an issue Sep 12, 2025 that may be closed by this pull request
@crypto-a crypto-a requested a review from Copilot September 12, 2025 19:28
Copy link
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 enhances the CI pipeline to enforce 100% code coverage on all pull requests. The build will now fail if coverage falls below 100%, ensuring high code quality standards.

  • Replaces simple test execution with coverage-enabled testing that excludes specific directories
  • Adds strict 100% coverage validation that fails the build if not met
  • Integrates Codecov reporting for detailed coverage analysis
Comments suppressed due to low confidence (2)

.github/workflows/ci-build.yaml:17

  • Go version 1.24.x does not exist. The latest Go version as of my knowledge cutoff is 1.22.x. Please use a valid Go version like '1.22.x' or '1.21.x'.
          go-version: '1.24.x'

.github/workflows/ci-build.yaml:56

  • Go version 1.24.x does not exist. The latest Go version as of my knowledge cutoff is 1.22.x. Please use a valid Go version like '1.22.x' or '1.21.x'.
          go-version: '1.24.x'

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Made some additional fixes to the ci-build.yaml file.  Now it checks to makes sure that there is a tests/config.yaml file and that the excluded directories exist.
Copy link
Contributor

@crypto-a crypto-a left a comment

Choose a reason for hiding this comment

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

Approved

@crypto-a crypto-a merged commit 9e910f9 into main Sep 12, 2025
2 checks passed
@crypto-a crypto-a deleted the 4/edit-ci-pipeline-to-account-for-100-code-coverage branch September 12, 2025 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edit CI pipeline to account for 100% code coverage

3 participants