Aggregate coverage from multiple GH actions jobs

baggepinnen
Tue, 12 Dec 2023 10:43:23 +0000
Tooling

I have a repo which contains a main package and a sub package located in /lib, for which I run CI in parallel using multiple GH-actions jobs (groups). This generally works well, except that it’s tricky to get coverage reports including coverage from all jobs.

I make use of

      - uses: julia-actions/julia-processcoverage@v1
        with:
          directories: src,lib/ControlSystemsBase/src

to ensure that both src and the subpackage located in lib/ControlSystemsBase/src are included in the coverage, but this does not quite do what I want. Each job reports code coverage to codecov independently, and thus only includes the coverage for the code that was run for this particular job. This has the effect that the last job to finish and report the coverage “wins” by somehow overwriting the report of the earlier job, and codecov will thus only consider the lines covered by the last finishing job.

What I think I need to do is to let each job somehow save the .lcov files or the processed result, and then wait with processing coverage until the coverage info from all jobs is available. Does anyone know how to make something like this (or any other approach to the problem) happen using Github actions?

4 posts - 3 participants