-
Notifications
You must be signed in to change notification settings - Fork 11
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
ci: Generate local report in Tests
workflow and use proper script for fetch report
#1054
Conversation
WalkthroughThe GitHub Actions workflows have been updated to streamline the handling of coverage data. A new job for preparing coverage data has been introduced, and the process for downloading and processing coverage artifacts has been optimized using GitHub's scripting actions. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ? TipsChat with CodeRabbit Bot (
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (2)
- .github/workflows/tests.yml (1 hunks)
- .github/workflows/upload_coverage.yml (1 hunks)
Additional comments: 8
.github/workflows/tests.yml (6)
119-153: The
coverage_prepare
job is well-defined with clear steps for handling coverage data. It includes checking out the code, setting up Python, installing dependencies, downloading coverage data, combining coverage data, and uploading the combined coverage report. Ensure that thename
for the downloaded artifact in step 136 matches the name of the artifact uploaded by thetest_coverage
andtest_minimal
jobs. Also, verify that the retention policy aligns with the project's requirements.122-122: Verify that the
test_coverage
andtest_minimal
jobs are correctly configured to produce the coverage reports artifact thatcoverage_prepare
expects to download.125-129: The caching strategy in the
coverage_prepare
job is set up correctly. Confirm thatsetup.cfg
is the correct path for thecache-dependency-path
and it contains the project's dependencies to make effective use of the caching.133-133: The
coverage_prepare
job installscodecov
. Ensure thatcodecov
is the intended tool for handling coverage data and that it's compatible with the project's coverage reporting requirements.140-145: The steps to combine coverage data and generate a report in the
coverage_prepare
job appear to be correct. Confirm that thecoverage
command is available in the environment and that the paths specified (e.g.,coverage
) are correct and accessible.147-152: The
coverage_prepare
job uploads the coverage report as an artifact namedcoverage_xml
. Confirm that this name is consistent with the expected artifact name in any downstream workflows or jobs that might use this artifact. Also, verify that the retention policy of 5 days aligns with the project's requirements..github/workflows/upload_coverage.yml (2)
- 15-36: The updated workflow steps for downloading and unzipping the coverage data artifact appear to be correctly implemented. However, ensure that the artifact name
coverage_xml
matches the actual artifact produced by theTests
workflow and that thecodecov/codecov-action
step is correctly configured to find the unzipped coverage data.Verification successful
The verification process confirms that the
Tests
workflow produces an artifact namedcoverage_xml
, which matches the expected artifact name in theupload_coverage.yml
workflow. Additionally, thecodecov/codecov-action
is present in theupload_coverage.yml
workflow and is configured to fail the CI if there is an error and to use a token for authentication. The unzipped coverage data is expected to be in the workspace directory, which is the default location where thecodecov/codecov-action
looks for coverage files. Therefore, the changes appear to be correctly implemented in line with the PR objectives and summaries.* 33-34: Verify that the `GITHUB_WORKSPACE` environment variable is correctly set and that the `fs` module is available in the GitHub Actions runner environment where this workflow will be executed.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that the 'Tests' workflow produces an artifact named 'coverage_xml'. rg --type yaml -C3 'artifact.*coverage_xml' .github/workflows/tests.yml # Verify that the 'codecov/codecov-action' step is configured to find the unzipped coverage data. rg --type yaml -C3 'codecov/codecov-action' .github/workflows/tests.ymlLength of output: 145
Script:
#!/bin/bash # Broaden the search to find any artifact upload steps in the 'Tests' workflow. rg --type yaml 'upload-artifact' .github/workflows/tests.yml # Broaden the search to find any usage of the codecov action in the 'Tests' workflow. rg --type yaml 'codecov-action' .github/workflows/tests.ymlLength of output: 243
Script:
#!/bin/bash # Verify the exact name of the artifact being produced by the 'Tests' workflow. rg --type yaml 'name:.*artifact' .github/workflows/tests.yml # Verify the presence and configuration of the 'codecov/codecov-action' in the 'upload_coverage.yml' workflow. rg --type yaml 'codecov/codecov-action' .github/workflows/upload_coverage.ymlLength of output: 221
Script:
#!/bin/bash # Verify the parameters of the 'upload-artifact' step to find the actual name of the artifact in the 'Tests' workflow. rg --type yaml -A5 'upload-artifact' .github/workflows/tests.yml # Verify the configuration of the 'codecov/codecov-action' step in the 'upload_coverage.yml' workflow. rg --type yaml -A5 'codecov/codecov-action' .github/workflows/upload_coverage.ymlLength of output: 715
Script:
#!/bin/bash # Verify that the unzipped coverage data is placed in the workspace directory in the 'upload_coverage.yml' workflow. rg --type yaml -A5 'unzip' .github/workflows/upload_coverage.ymlLength of output: 280
@@ -116,6 +116,41 @@ jobs: | |||
tox_args: "-e py38-PyQt5-minimal" | |||
coverage: true | |||
|
|||
coverage_prepare: | |||
name: Prepare coverage | |||
runs-on: ubuntu-latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider pinning the runner version in the coverage_prepare
job to ubuntu-20.04
for consistency with other jobs and to avoid potential issues when the ubuntu-latest
runner is updated.
Tests
workflow and use proper script for fetch report
Summary by CodeRabbit