Skip to content

Commit d6e34ff

Browse files
ci: upload Codecov after all tests complete
1 parent 2ce8ce9 commit d6e34ff

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@v4
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@v4
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@v4
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)