Skip to content

Commit e5e35ec

Browse files
authored
CI: Enable code coverage (#252)
1 parent b4b4a07 commit e5e35ec

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/ci.yml

+26-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ jobs:
5151
with:
5252
version: ${{ matrix.version }}
5353
- uses: julia-actions/julia-runtest@v1
54+
- run: find . -type f -name '*.cov'
55+
# - run: find . -type f -name '*.c ov' -exec cat {} \;
56+
- uses: julia-actions/julia-processcoverage@v1
57+
- uses: codecov/codecov-action@v5
58+
with:
59+
files: lcov.info
60+
token: ${{ secrets.CODECOV_TOKEN }}
61+
# If this PR is from a fork, then do NOT fail CI if the Codecov upload errors.
62+
# If this PR is NOT from a fork, then DO fail CI if the Codecov upload errors.
63+
# If this is not a PR, then DO fail CI if the Codecov upload errors.
64+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name }}
5465
test-slurm:
5566
runs-on: ubuntu-latest
5667
timeout-minutes: 20
@@ -95,6 +106,20 @@ jobs:
95106
- name: Run tests without a Slurm allocation
96107
run: docker exec -t slurmctld julia --project=ClusterManagers -e 'import Pkg; Pkg.test(; test_args=["slurm"])'
97108
- name: Run tests inside salloc
98-
run: docker exec -t slurmctld salloc -t 00:10:00 -n 2 julia --project=ClusterManagers -e 'import Pkg; Pkg.test(test_args=["slurm"])'
109+
run: docker exec -t slurmctld salloc -t 00:10:00 -n 2 julia --project=ClusterManagers -e 'import Pkg; Pkg.test(; test_args=["slurm"], coverage=true)'
99110
- name: Run tests inside sbatch
100111
run: docker exec -t slurmctld ClusterManagers/ci/run_my_sbatch.sh
112+
- run: find . -type f -name '*.cov'
113+
- name: Copy .cov files out of the Docker container
114+
run: docker exec slurmctld /bin/bash -c 'cd /home/docker/ClusterManagers && tar -cf - src/*.cov' | tar -xvf -
115+
- run: find . -type f -name '*.cov'
116+
# - run: find . -type f -name '*.cov' -exec cat {} \;
117+
- uses: julia-actions/julia-processcoverage@v1
118+
- uses: codecov/codecov-action@v5
119+
with:
120+
files: lcov.info
121+
token: ${{ secrets.CODECOV_TOKEN }}
122+
# If this PR is from a fork, then do NOT fail CI if the Codecov upload errors.
123+
# If this PR is NOT from a fork, then DO fail CI if the Codecov upload errors.
124+
# If this is not a PR, then DO fail CI if the Codecov upload errors.
125+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name }}

0 commit comments

Comments
 (0)