From fa7026fab55395c746bd13dc7787301a93c318b5 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Tue, 9 Jul 2024 19:48:02 +0200 Subject: [PATCH 1/3] Re-enable coverage uploads --- .github/workflows/Tests.yml | 43 +++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 4f8ac4dcc5..c28c84ac40 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -72,16 +72,37 @@ jobs: with: version: '${{ matrix.version }}' arch: ${{ matrix.arch }} - - uses: actions/cache@v4 + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + # TODO: Use julia-actions/julia-runtest when test_args are supported + # Custom calls of Pkg.test tend to miss features such as e.g. adjustments for CompatHelper PRs + # Ref https://github.com/julia-actions/julia-runtest/pull/73 + - name: Call Pkg.test + 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 }} env: - cache-name: cache-artifacts + COVERAGE: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 }} + - uses: julia-actions/julia-processcoverage@v1 + if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 + - uses: codecov/codecov-action@v4 + if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@latest - - name: Call Pkg.test - 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 }} + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + file: lcov.info + - uses: coverallsapp/github-action@v2 + if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: lcov.info + flag-name: run-${{ join(matrix.*, '-') }} + parallel: true + + finish: + needs: test + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + parallel-finished: true From 5e2542a1c03adaac74c5672707062fb45b22e45c Mon Sep 17 00:00:00 2001 From: David Widmann Date: Wed, 10 Jul 2024 10:45:42 +0200 Subject: [PATCH 2/3] Use COVERAGE env variable to (de)activate coverage analysis consistently --- .github/workflows/Tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index c28c84ac40..2e7e0a78ff 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -67,6 +67,8 @@ jobs: echo "Julia version: ${{ matrix.version }}" echo "Number of threads: ${{ matrix.num_threads }}" echo "Test arguments: ${{ matrix.test-args }}" + - name: (De)activate coverage analysis + run: echo "COVERAGE=${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 }}" >> "$GITHUB_ENV" - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 with: @@ -79,18 +81,16 @@ jobs: # Ref https://github.com/julia-actions/julia-runtest/pull/73 - name: Call Pkg.test 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 }} - env: - COVERAGE: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 }} - uses: julia-actions/julia-processcoverage@v1 - if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 + if: ${{ env.COVERAGE }} - uses: codecov/codecov-action@v4 - if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 + if: ${{ env.COVERAGE }} with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} file: lcov.info - uses: coverallsapp/github-action@v2 - if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 + if: ${{ env.COVERAGE }} with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.info From 9632edb2c394eff29b340a29cd03006a3037a6eb Mon Sep 17 00:00:00 2001 From: David Widmann Date: Wed, 10 Jul 2024 10:57:49 +0200 Subject: [PATCH 3/3] Use bash shell on Windows as well --- .github/workflows/Tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 2e7e0a78ff..8de296e5ee 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -69,6 +69,7 @@ jobs: echo "Test arguments: ${{ matrix.test-args }}" - name: (De)activate coverage analysis run: echo "COVERAGE=${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.num_threads == 2 }}" >> "$GITHUB_ENV" + shell: bash - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 with: