Skip to content

Commit 51a7b54

Browse files
committed
Separate GPU test
1 parent 4334c2a commit 51a7b54

2 files changed

Lines changed: 119 additions & 76 deletions

File tree

.github/workflows/Test-GPU.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test-GPU
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
12+
13+
# needed to allow julia-actions/cache to delete old caches that it has created
14+
permissions:
15+
actions: write
16+
contents: read
17+
18+
jobs:
19+
test:
20+
runs-on: self-hosted
21+
env:
22+
CUDA_VISIBLE_DEVICES: 1
23+
JULIA_DEPOT_PATH: /scratch/github-actions/julia_depot_smc
24+
JULIA_SMC_TEST_GROUP: "GPU"
25+
strategy:
26+
matrix:
27+
julia-version: ['1.10', '1']
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: julia-actions/setup-julia@v2
31+
with:
32+
version: ${{ matrix.julia-version }}
33+
arch: x64
34+
- uses: julia-actions/julia-downgrade-compat@v1
35+
if: ${{ matrix.version == '1.10' }}
36+
with:
37+
skip: LinearAlgebra, Random, SparseArrays
38+
- uses: julia-actions/cache@v2
39+
- uses: julia-actions/julia-buildpkg@v1
40+
- uses: julia-actions/julia-runtest@v1
41+
- uses: julia-actions/julia-processcoverage@v1
42+
- uses: codecov/codecov-action@v5
43+
with:
44+
files: lcov.info
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
fail_ci_if_error: false

test/runtests.jl

Lines changed: 73 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -11,86 +11,83 @@ using Colors: Colors
1111
include("utils.jl")
1212

1313
@testset verbose = true "SparseMatrixColorings" begin
14-
@testset verbose = true "Code quality" begin
15-
@testset "Aqua" begin
16-
Aqua.test_all(SparseMatrixColorings; stale_deps=(; ignore=[:Requires],))
17-
end
18-
@testset "JET" begin
19-
JET.test_package(SparseMatrixColorings; target_defined_modules=true)
20-
end
21-
@testset "JuliaFormatter" begin
22-
@test JuliaFormatter.format(
23-
SparseMatrixColorings; verbose=false, overwrite=false
24-
)
25-
end
26-
@testset "Doctests" begin
27-
Documenter.doctest(SparseMatrixColorings)
28-
end
29-
end
30-
@testset verbose = true "Internals" begin
31-
@testset "Graph" begin
32-
include("graph.jl")
33-
end
34-
@testset "Forest" begin
35-
include("forest.jl")
36-
end
37-
@testset "Order" begin
38-
include("order.jl")
39-
end
40-
@testset "Check" begin
41-
include("check.jl")
42-
end
43-
@testset "Matrices" begin
44-
include("matrices.jl")
45-
end
46-
@testset "Constructors" begin
47-
include("constructors.jl")
48-
end
49-
@testset "Result" begin
50-
include("result.jl")
51-
end
52-
@testset "Constant coloring" begin
53-
include("constant.jl")
54-
end
55-
@testset "ADTypes coloring algorithms" begin
56-
include("adtypes.jl")
57-
end
58-
@testset "Visualization" begin
59-
include("show_colors.jl")
60-
end
61-
end
62-
@testset verbose = true "Correctness" begin
63-
@testset "Small instances" begin
64-
include("small.jl")
65-
end
66-
@testset "Random instances" begin
67-
include("random.jl")
68-
end
69-
@testset "Structured matrices" begin
70-
include("structured.jl")
71-
end
72-
@testset "Instances with known colorings" begin
73-
include("theory.jl")
14+
if get(ENV, "JULIA_SMC_TEST_GROUP", nothing) == "GPU"
15+
@testset "CUDA" begin
16+
using CUDA
17+
include("cuda.jl")
7418
end
75-
@testset "SuiteSparse" begin
76-
include("suitesparse.jl")
19+
else
20+
@testset verbose = true "Code quality" begin
21+
@testset "Aqua" begin
22+
Aqua.test_all(SparseMatrixColorings; stale_deps=(; ignore=[:Requires],))
23+
end
24+
@testset "JET" begin
25+
JET.test_package(SparseMatrixColorings; target_defined_modules=true)
26+
end
27+
@testset "JuliaFormatter" begin
28+
@test JuliaFormatter.format(
29+
SparseMatrixColorings; verbose=false, overwrite=false
30+
)
31+
end
32+
@testset "Doctests" begin
33+
Documenter.doctest(SparseMatrixColorings)
34+
end
7735
end
78-
end
79-
@testset verbose = true "Performance" begin
80-
@testset "Type stability" begin
81-
include("type_stability.jl")
36+
@testset verbose = true "Internals" begin
37+
@testset "Graph" begin
38+
include("graph.jl")
39+
end
40+
@testset "Forest" begin
41+
include("forest.jl")
42+
end
43+
@testset "Order" begin
44+
include("order.jl")
45+
end
46+
@testset "Check" begin
47+
include("check.jl")
48+
end
49+
@testset "Matrices" begin
50+
include("matrices.jl")
51+
end
52+
@testset "Constructors" begin
53+
include("constructors.jl")
54+
end
55+
@testset "Result" begin
56+
include("result.jl")
57+
end
58+
@testset "Constant coloring" begin
59+
include("constant.jl")
60+
end
61+
@testset "ADTypes coloring algorithms" begin
62+
include("adtypes.jl")
63+
end
64+
@testset "Visualization" begin
65+
include("show_colors.jl")
66+
end
8267
end
83-
@testset "Allocations" begin
84-
include("allocations.jl")
68+
@testset verbose = true "Correctness" begin
69+
@testset "Small instances" begin
70+
include("small.jl")
71+
end
72+
@testset "Random instances" begin
73+
include("random.jl")
74+
end
75+
@testset "Structured matrices" begin
76+
include("structured.jl")
77+
end
78+
@testset "Instances with known colorings" begin
79+
include("theory.jl")
80+
end
81+
@testset "SuiteSparse" begin
82+
include("suitesparse.jl")
83+
end
8584
end
86-
end
87-
@testset verbose = true "GPU" begin
88-
@testset "CUDA" begin
89-
using CUDA
90-
if CUDA.functional()
91-
include("cuda.jl")
92-
else
93-
@test_broken CUDA.functional()
85+
@testset verbose = true "Performance" begin
86+
@testset "Type stability" begin
87+
include("type_stability.jl")
88+
end
89+
@testset "Allocations" begin
90+
include("allocations.jl")
9491
end
9592
end
9693
end

0 commit comments

Comments
 (0)