Skip to content

Commit 142dab3

Browse files
authored
Re-enable coverage uploads (#2283)
* Re-enable coverage uploads * Use COVERAGE env variable to (de)activate coverage analysis consistently * Use bash shell on Windows as well
1 parent 464e116 commit 142dab3

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

.github/workflows/Tests.yml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,43 @@ jobs:
6767
echo "Julia version: ${{ matrix.version }}"
6868
echo "Number of threads: ${{ matrix.num_threads }}"
6969
echo "Test arguments: ${{ matrix.test-args }}"
70+
- name: (De)activate coverage analysis
71+
run: echo "COVERAGE=${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 }}" >> "$GITHUB_ENV"
72+
shell: bash
7073
- uses: actions/checkout@v4
7174
- uses: julia-actions/setup-julia@v2
7275
with:
7376
version: '${{ matrix.version }}'
7477
arch: ${{ matrix.arch }}
75-
- uses: actions/cache@v4
76-
env:
77-
cache-name: cache-artifacts
78-
with:
79-
path: ~/.julia/artifacts
80-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
81-
restore-keys: |
82-
${{ runner.os }}-test-${{ env.cache-name }}-
83-
${{ runner.os }}-test-
84-
${{ runner.os }}-
85-
- uses: julia-actions/julia-buildpkg@latest
78+
- uses: julia-actions/cache@v1
79+
- uses: julia-actions/julia-buildpkg@v1
80+
# TODO: Use julia-actions/julia-runtest when test_args are supported
81+
# Custom calls of Pkg.test tend to miss features such as e.g. adjustments for CompatHelper PRs
82+
# Ref https://github.com/julia-actions/julia-runtest/pull/73
8683
- name: Call Pkg.test
87-
run: julia --color=yes --depwarn=yes --check-bounds=yes --threads=${{ matrix.num_threads }} --project=@. -e 'import Pkg; Pkg.test(; test_args=ARGS)' -- ${{ matrix.test-args }}
84+
run: julia --color=yes --inline=yes --depwarn=yes --check-bounds=yes --threads=${{ matrix.num_threads }} --project=@. -e 'import Pkg; Pkg.test(; coverage=parse(Bool, ENV["COVERAGE"]), test_args=ARGS)' -- ${{ matrix.test-args }}
85+
- uses: julia-actions/julia-processcoverage@v1
86+
if: ${{ env.COVERAGE }}
87+
- uses: codecov/codecov-action@v4
88+
if: ${{ env.COVERAGE }}
89+
with:
90+
fail_ci_if_error: true
91+
token: ${{ secrets.CODECOV_TOKEN }}
92+
file: lcov.info
93+
- uses: coverallsapp/github-action@v2
94+
if: ${{ env.COVERAGE }}
95+
with:
96+
github-token: ${{ secrets.GITHUB_TOKEN }}
97+
path-to-lcov: lcov.info
98+
flag-name: run-${{ join(matrix.*, '-') }}
99+
parallel: true
100+
101+
finish:
102+
needs: test
103+
if: ${{ always() }}
104+
runs-on: ubuntu-latest
105+
steps:
106+
- name: Coveralls Finished
107+
uses: coverallsapp/github-action@v2
108+
with:
109+
parallel-finished: true

0 commit comments

Comments
 (0)