Skip to content

Commit 3d2bd6d

Browse files
authored
Codecov hack for @threads (#55)
* Codecov hack for @threads * codecov token
1 parent b14c280 commit 3d2bd6d

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,34 @@ jobs:
2727
os: [ubuntu-latest, windows-latest, macOS-latest]
2828
steps:
2929
- uses: actions/checkout@v4
30+
3031
# - name: "Set up Julia"
3132
- uses: julia-actions/setup-julia@latest
3233
with:
3334
version: ${{ matrix.version }}
35+
36+
- name: Cache artifacts
37+
uses: actions/cache@v4
38+
env:
39+
cache-name: cache-artifacts
40+
with:
41+
path: ~/.julia/artifacts
42+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
43+
restore-keys: |
44+
${{ runner.os }}-test-${{ env.cache-name }}-
45+
${{ runner.os }}-test-
46+
${{ runner.os }}-
47+
3448
# - name: "Unit Test"
3549
- uses: julia-actions/julia-buildpkg@latest
3650
- uses: julia-actions/julia-runtest@latest
51+
3752
# - name: "Cover"
3853
- uses: julia-actions/julia-processcoverage@v1
3954
- uses: codecov/codecov-action@v5
4055
if: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' }}
4156
with:
4257
file: lcov.info
58+
fail_ci_if_error: false
59+
env:
60+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

src/backproject.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function backproject!(
2323
plan.planrot[thid],
2424
)
2525

26-
end
26+
end # COV_EXCL_LINE
2727

2828
# adjoint of convolving img with psf and applying attenuation map
2929
Threads.@threads for y in 1:plan.imgsize[2] # 1:ny
@@ -45,7 +45,7 @@ function backproject!(
4545
)
4646

4747
mul3dj!(plan.imgr, plan.exp_mumapr[thid], y)
48-
end
48+
end # COV_EXCL_LINE
4949

5050
# adjoint of rotating image
5151
Threads.@threads for z in 1:plan.imgsize[3] # 1:nz
@@ -56,7 +56,7 @@ function backproject!(
5656
plan.viewangle[viewidx],
5757
plan.planrot[thid],
5858
)
59-
end
59+
end # COV_EXCL_LINE
6060

6161
return image
6262
end
@@ -142,7 +142,7 @@ function backproject!(
142142
Threads.@threads for (i, viewidx) in collect(enumerate(index))
143143
thid = Threads.threadid()
144144
backproject!(plan.add_img[thid], (@view views[:, :, i]), plan, thid, viewidx)
145-
end
145+
end # COV_EXCL_LINE
146146

147147
for i in 1:plan.nthread
148148
broadcast!(+, image, image, plan.add_img[i])

src/project.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function project!(
3131
plan.viewangle[viewidx],
3232
plan.planrot[thid],
3333
)
34-
end
34+
end # COV_EXCL_LINE
3535

3636
Threads.@threads for y in 1:plan.imgsize[2] # 1:ny
3737
thid = Threads.threadid() # thread id
@@ -55,7 +55,7 @@ function project!(
5555
(@view plan.psfs[:, :, y, viewidx]),
5656
plan.planpsf[thid],
5757
)
58-
end
58+
end # COV_EXCL_LINE
5959

6060
copy3dj!(view, plan.add_img, 1) # initialize accumulator
6161
for y in 2:plan.imgsize[2] # accumulate to get total view
@@ -151,7 +151,7 @@ function project!(
151151
Threads.@threads for (i, viewidx) in collect(enumerate(index))
152152
thid = Threads.threadid()
153153
project!((@view views[:,:,i]), image, plan, thid, viewidx)
154-
end
154+
end # COV_EXCL_LINE
155155
else
156156
for (i, viewidx) in collect(enumerate(index))
157157
project!((@view views[:,:,i]), image, plan, viewidx)

src/rotatez.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ function _imrotate!(
520520
θ,
521521
plans[id],
522522
)
523-
end
523+
end # COV_EXCL_LINE
524524

525525
return output
526526
end

0 commit comments

Comments
 (0)