File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 45
45
- uses : codecov/codecov-action@v2
46
46
with :
47
47
files : lcov.info
48
-
48
+ multithreads :
49
+ name : Julia (threads) 1 - ubuntu-latest - x64 - ${{ github.event_name }}
50
+ runs-on : ubuntu-latest
51
+ steps :
52
+ - uses : actions/checkout@v2
53
+ - uses : julia-actions/setup-julia@v1
54
+ with :
55
+ version : ' 1'
56
+ arch : ' x64'
57
+ - uses : julia-actions/cache@v1
58
+ - uses : julia-actions/julia-buildpkg@v1
59
+ - name : run test
60
+ run : julia --project --code-coverage -t4 -e 'using Pkg; Pkg.test()'
61
+ - uses : julia-actions/julia-processcoverage@v1
62
+ - uses : codecov/codecov-action@v2
63
+ with :
64
+ files : lcov.info
Original file line number Diff line number Diff line change 47
47
end
48
48
49
49
include (" tst_encode.jl" )
50
+ if Threads. nthreads () > 1
51
+ @info " Multi-threads test: enabled"
52
+ include (" tst_multithreads.jl" )
53
+ else
54
+ @info " Multi-threads test: skipped"
55
+ end
50
56
end
Original file line number Diff line number Diff line change
1
+ @testset " multithreads" begin
2
+ @test Threads. nthreads () > 1
3
+
4
+ img = testimage (" lighthouse" )
5
+ @testset " jpeg_encode" begin
6
+ ref = jpeg_encode (img)
7
+
8
+ out = [fill (zero (UInt8), size (ref)) for _ in 1 : Threads. nthreads ()]
9
+ Threads. @threads for i in 1 : Threads. nthreads ()
10
+ out[i] = jpeg_encode (img)
11
+ end
12
+ @test all (out .== Ref (ref))
13
+ end
14
+ end
You can’t perform that action at this time.
0 commit comments