Git Product home page Git Product logo

Comments (5)

rfgamaral avatar rfgamaral commented on August 22, 2024 5

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):

image

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?

from codecov-action.

zhuanyan-wang avatar zhuanyan-wang commented on August 22, 2024 5

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:

strategy:
  matrix:
    os: [ubuntu-latest, windows-latest, macos-latest]
    node-version: [10.x, 12.x, 14.x]

runs-on: ${{ matrix.os }}

steps:
  - name: Post Coverage
    uses: codecov/codecov-action@v1
    if: matrix.os == 'ubuntu-latest' && matrix.node-version == '10.x'

This posts the coverage reports to Codecov, only when the OS is ubuntu-latest and the Node.js version is 10.x. Just change if: 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:

Annotation 2020-07-05 183237

Two subdirectories Default and Container have posted their reports once only (otherwise there will be 12 builds here):

Annotation 2020-07-05 183211

from codecov-action.

jhidding avatar jhidding commented on August 22, 2024 1

Github Actions gives a connection time-out, retries after 30 seconds end-so-on.

from codecov-action.

ibrahim0814 avatar ibrahim0814 commented on August 22, 2024

Hello @jhidding, thank you for bringing this up!

Regarding your issue about how uploads often fail after the first one - could you elaborate more on this? What error do you see on the console? Uploads to Codecov shouldn't fail after the first build in the matrix, but if that's the case, perhaps we need to investigate this issue on our end because other users might be affected by it

from codecov-action.

ibrahim0814 avatar ibrahim0814 commented on August 22, 2024

@jhidding Any updates on this particular issue? If the problem still persists, we can punch in a support ticket

from codecov-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.