diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 4f8ac4dcc..8de296e5e 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -67,21 +67,43 @@ 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" + shell: bash - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 with: version: '${{ matrix.version }}' arch: ${{ matrix.arch }} - - uses: actions/cache@v4 - env: - cache-name: cache-artifacts - 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 + - 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 --depwarn=yes --check-bounds=yes --threads=${{ matrix.num_threads }} --project=@. -e 'import Pkg; Pkg.test(; test_args=ARGS)' -- ${{ matrix.test-args }} + 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 }} + - uses: julia-actions/julia-processcoverage@v1 + if: ${{ env.COVERAGE }} + - uses: codecov/codecov-action@v4 + if: ${{ env.COVERAGE }} + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + file: lcov.info + - uses: coverallsapp/github-action@v2 + if: ${{ env.COVERAGE }} + 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