Add documentation on matrix build, only upload coverage once
See original GitHub issueIssue Description
When testing in a matrix, uploads often fail after the first one. I’m testing against different versions of Python, and I only need to upload the coverage information once, by including
if: matrix.python-version == 3.8
in the codecov job. It took me a while to figure this out, so maybe it is nice to include this in the readme.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Generating test coverage reports only once within a GitHub ...
I want to generate a code coverage report for my tests, but only for a single matrix item. Here is a copy of...
Read more >Requirements Module in HP ALM (Quality Center) Tutorial
In this tutorial, we create Requirement, Upload Requirement using Microsoft Excel and generate coverage analysis and traceability Matrix.
Read more >How to Ditch Codecov for Python Projects - Hynek Schlawack
I have found a way to enforce coverage over a whole GitHub Actions build matrix that doesn't rely on third-party services. Coverage.py has...
Read more >How to Generate a Code Coverage Report with CodeCov and ...
Hpw tp create a project and generate a coverage report · Step 1: Create a directory and navigate to it · Step 2:...
Read more >Traceability and Test Coverage in TestRail
How do you create a traceability report in TestRail? ... What is a Requirements Traceability Matrix (“RTM”)?; How to start tracking ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Multiple Node.js and multiple OS
Expand on what @jhidding and @rfgamaral have said. If you are testing on multiple Node.js versions and multiple OS at the same time, something like this will work:
This posts the coverage reports to Codecov, only when the OS is
ubuntu-latest
and the Node.js version is10.x
. Just changeif: matrix.os == 'ubuntu-latest' && matrix.node-version == '10.x'
based on your own setup.Result
The
Post Coverage
is skipped when the OS or the Node.js version does not match:Two subdirectories
Default
andContainer
have posted their reports once only (otherwise there will be 12 builds here):I’ve started using Codecov with GitHub Actions (on this test project for now) and I’m wondering what’s the best practice for matrix builds!?
This particular project tests the code against 3 different Node.js version and with my current workflow I’m uploading 3 different coverage reports (but they are always the same):
This doesn’t make much sense to me. Ideally, only one coverage report would be uploaded.
Now, I understand I can add an
if
statement to the upload step like @jhidding mentioned in the original post, but somehow that feels like a hacky solution.What is the recommended best practice to upload the coverage report only once independently of the number of jobs due to matrix configurations in GitHub actions?