Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Codecov workflow and badge #120

Merged
merged 22 commits into from
Aug 22, 2023
Merged

Add Codecov workflow and badge #120

merged 22 commits into from
Aug 22, 2023

Conversation

christianhelle
Copy link
Owner

Public Codecov project:
https://app.codecov.io/gh/christianhelle/refitter

Current coverage graph

Christian Helle and others added 22 commits August 22, 2023 08:32
Changed the installation process of the dotnet-coverageconverter from local to global. This eases the workflow by enabling the use of the tool across different directory paths without the need for specifying the tool-path each time. This change also simplifies the command to run the tool.
Added src/.tools to .gitignore file to prevent tracking of tooling configuration or metadata files that might interfere with other team members' local development environments.
Adjusted the 'build.yml' script to include .coveragexml files in the Codecov action. This will enable more comprehensive test coverage analysis.
The shell to run the coverage conversion was set to `pwsh` to ensure PowerShell is used. A new command was added to move all `*.coveragexml` files to the current directory. This is necessary to ensure all coverage files are found when uploading to Codecov regardless of their initial directory. The `files` property was updated in the `Upload coverage reports to Codecov` step to use the updated file location.
The handling of coverage files in the Github build workflow has been updated. This change selects the first coverage file instead of processing all coverage files. The selected file is then copied and renamed for upload to Codecov, helping to streamline our CI process.
In this commit, the usage of explicit CODECOV_TOKEN has been removed from .github/workflows/build.yml file.

This change was necessary because GitHub actions codecov/codecov-action@v3 does not require handling this secret as it's now automatically inferred for public repositories. This further enhances security by reducing exposure of secrets.
Changed the destination file extension in the Copy-Item command within the GitHub build workflow. Instead of generating ".coverage.xml" files, the command now produces ".xml" files. This change aims to ensure consistency in the file naming convention used across the project.
Modified the GitHub action workflow to enhance the code coverage reporting process. The coverage output file name is now standardized as 'coverage.xml', improving consistency. Also, Codecov-action is now provided with token, file path, flags and error handling inputs, ensuring error-free and verbose code coverage reports. These changes make code coverage handling more robust and accessible across the application.
Updated the destination path from "coverage.xml" to "./coverage.xml" in the Copy-Item command within the .github/workflows/build.yml file. This change provides an explicit file path and ensures more secure and predictable file operations.
The codecov action path previously pointed to a specific file for test coverage. It has been updated to point to the entire 'src' directory. This change is made to ensure codecov can access all test coverage files and not just one specific file. This provides a more accurate and comprehensive test coverage report.
The diff simplifies the line used to copy the coverage.xml file in the GitHub Actions build workflow (build.yml) file. This change makes the command easier to understand and maintain.
The build system has been migrated from 'ubuntu-latest' to 'windows-latest'. This change was necessary due to compatibility issues in our development system.
Also, redundant 'Upload coverage to Codecov' parameters were removed in an attempt to diagnose and fix a failed CI build. This adjustment streamlines our workflow, reducing redundancy and potential points of failure.
This commit enhances our CI/CD pipeline by automatically generating code coverage reports for each build. We now locate the first '.coveragexml' file in any directory tree, duplicate it and move the copy to the root directory. This coverage report is then uploaded to Codecov using the relevant action. As a part of this change, we also use the Codecov token stored in the repository secrets, specify the directory and file for Codecov, set flags, handle error cases and set verbosity. This will provide better visibility into our test coverage and pave way for maintaining high-quality code.
Added the configuration file for Codecov code coverage service in the GitHub workflow. This configuration allows us to automatically generate, convert, and upload the code coverage reports to Codecov after each build. This workflow triggers on each push and PR for all branches, providing us with continual insight into the code coverage status.
@christianhelle christianhelle added the enhancement New feature, bug fix, or request label Aug 22, 2023
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@397d0d6). Click here to learn what that means.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main     #120   +/-   ##
=======================================
  Coverage        ?   86.21%           
=======================================
  Files           ?       34           
  Lines           ?     1030           
  Branches        ?        0           
=======================================
  Hits            ?      888           
  Misses          ?      131           
  Partials        ?       11           
Flag Coverage Δ
unittests 86.21% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@christianhelle christianhelle merged commit 7b01141 into main Aug 22, 2023
@christianhelle christianhelle deleted the codecov branch August 22, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, bug fix, or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants