Skip to content

Commit 5f73996

Browse files
authored
ci: upload Codecov only after all test jobs finish (#155)
* ci: upload Codecov after all tests complete * chore(ci): bump artifact actions
2 parents 2ce8ce9 + 7dccac6 commit 5f73996

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

.github/workflows/CI.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ jobs:
5454
julia --color=yes --threads=auto --check-bounds=yes --depwarn=yes --code-coverage=user -e 'import Coverage; import Pkg; Pkg.activate("."); Pkg.test(coverage=true)'
5555
julia --color=yes coverage.jl
5656
shell: bash
57-
- uses: codecov/codecov-action@v5
57+
- name: Upload coverage artifact
58+
if: success()
59+
uses: actions/upload-artifact@v6
5860
with:
59-
token: ${{ secrets.CODECOV_TOKEN }}
60-
files: lcov.info
61+
name: coverage-${{ matrix.os }}-julia-${{ matrix.julia-version }}
62+
path: lcov.info
6163

6264

6365
additional_tests:
@@ -89,8 +91,37 @@ jobs:
8991
SR_TEST=${{ matrix.test_name }} julia --color=yes --threads=auto --check-bounds=yes --depwarn=yes --code-coverage=user -e 'import Coverage; import Pkg; Pkg.activate("."); Pkg.test(coverage=true)'
9092
julia --color=yes coverage.jl
9193
shell: bash
92-
- uses: codecov/codecov-action@v5
94+
- name: Upload coverage artifact
9395
if: steps.run-tests.outcome == 'success'
96+
uses: actions/upload-artifact@v6
97+
with:
98+
name: coverage-${{ matrix.test_name }}-${{ matrix.os }}-julia-${{ matrix.julia-version }}
99+
path: lcov.info
100+
101+
102+
codecov:
103+
name: Upload combined coverage to Codecov
104+
runs-on: ubuntu-latest
105+
needs:
106+
- test
107+
- additional_tests
108+
steps:
109+
- name: Download coverage artifacts
110+
uses: actions/download-artifact@v7
111+
with:
112+
pattern: coverage-*
113+
path: coverage
114+
115+
- name: Merge lcov files
116+
run: |
117+
set -euxo pipefail
118+
cd coverage
119+
find . -name 'lcov.info' -print
120+
cat $(find . -name 'lcov.info' -print | sort) > merged-lcov.info
121+
wc -l merged-lcov.info
122+
123+
- name: Upload to Codecov
124+
uses: codecov/codecov-action@v5
94125
with:
95126
token: ${{ secrets.CODECOV_TOKEN }}
96-
files: lcov.info
127+
files: coverage/merged-lcov.info

0 commit comments

Comments
 (0)