Skip to content

Commit 25de233

Browse files
authored
Add OpenCL.jl to CI. (#563)
1 parent 185da5e commit 25de233

File tree

2 files changed

+135
-27
lines changed

2 files changed

+135
-27
lines changed

.buildkite/pipeline.yml

Lines changed: 83 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,35 @@ steps:
88
command: |
99
julia -e 'using Pkg
1010
11-
println("--- :julia: Instantiating project")
12-
Pkg.develop(; path=pwd())
13-
Pkg.develop(; name="CUDA")
11+
gpuarrays = pwd()
12+
gpuarrayscore = joinpath(gpuarrays, "lib", "GPUArraysCore")
13+
devdir = mktempdir()
14+
package = joinpath(devdir, "CUDA")
15+
16+
println("--- :julia: Installing TestEnv")
17+
Pkg.activate(; temp=true)
18+
Pkg.add("TestEnv")
19+
using TestEnv
20+
21+
println("--- :julia: Installing CUDA.jl")
22+
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0,
23+
"JULIA_PKG_DEVDIR" => devdir) do
24+
Pkg.develop("CUDA")
25+
Pkg.activate(package)
26+
27+
try
28+
Pkg.develop([PackageSpec(path=gpuarrays), PackageSpec(path=gpuarrayscore)])
29+
TestEnv.activate()
30+
catch err
31+
@error "Could not install CUDA.jl" exception=(err,catch_backtrace())
32+
exit(3)
33+
finally
34+
Pkg.activate(package)
35+
end
36+
end
1437
1538
println("+++ :julia: Running tests")
16-
Pkg.test("CUDA"; coverage=true)'
39+
Pkg.test(; coverage=true)'
1740
agents:
1841
queue: "juliagpu"
1942
cuda: "*"
@@ -27,18 +50,38 @@ steps:
2750
- JuliaCI/julia-coverage#v1:
2851
codecov: true
2952
command: |
30-
julia -e 'using Pkg;
53+
julia -e 'using Pkg
54+
55+
gpuarrays = pwd()
56+
gpuarrayscore = joinpath(gpuarrays, "lib", "GPUArraysCore")
57+
devdir = mktempdir()
58+
package = joinpath(devdir, "oneAPI")
3159
32-
println("--- :julia: Instantiating project")
33-
Pkg.develop(; path=pwd())
34-
Pkg.develop(; name="oneAPI")
60+
println("--- :julia: Installing TestEnv")
61+
Pkg.activate(; temp=true)
62+
Pkg.add("TestEnv")
63+
using TestEnv
3564
36-
println("+++ :julia: Building support library")
37-
include(joinpath(Pkg.devdir(), "oneAPI", "deps", "build_ci.jl"))
38-
Pkg.activate()
65+
println("--- :julia: Installing oneAPI.jl")
66+
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0,
67+
"JULIA_PKG_DEVDIR" => devdir) do
68+
Pkg.develop("oneAPI")
69+
include(joinpath(package, "deps", "build_ci.jl"))
70+
Pkg.activate(package)
71+
72+
try
73+
Pkg.develop([PackageSpec(path=gpuarrays), PackageSpec(path=gpuarrayscore)])
74+
TestEnv.activate()
75+
catch err
76+
@error "Could not install oneAPI.jl" exception=(err,catch_backtrace())
77+
exit(3)
78+
finally
79+
Pkg.activate(package)
80+
end
81+
end
3982
4083
println("+++ :julia: Running tests")
41-
Pkg.test("oneAPI"; coverage=true)'
84+
Pkg.test(; coverage=true)'
4285
agents:
4386
queue: "juliagpu"
4487
intel: "*"
@@ -52,14 +95,37 @@ steps:
5295
- JuliaCI/julia-coverage#v1:
5396
codecov: true
5497
command: |
55-
julia -e 'using Pkg;
98+
julia -e 'using Pkg
99+
100+
gpuarrays = pwd()
101+
gpuarrayscore = joinpath(gpuarrays, "lib", "GPUArraysCore")
102+
devdir = mktempdir()
103+
package = joinpath(devdir, "Metal")
104+
105+
println("--- :julia: Installing TestEnv")
106+
Pkg.activate(; temp=true)
107+
Pkg.add("TestEnv")
108+
using TestEnv
109+
110+
println("--- :julia: Installing Metal.jl")
111+
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0,
112+
"JULIA_PKG_DEVDIR" => devdir) do
113+
Pkg.develop("Metal")
114+
Pkg.activate(package)
56115
57-
println("--- :julia: Instantiating project")
58-
Pkg.develop(; path=pwd())
59-
Pkg.develop(; name="Metal")
116+
try
117+
Pkg.develop([PackageSpec(path=gpuarrays), PackageSpec(path=gpuarrayscore)])
118+
TestEnv.activate()
119+
catch err
120+
@error "Could not install Metal.jl" exception=(err,catch_backtrace())
121+
exit(3)
122+
finally
123+
Pkg.activate(package)
124+
end
125+
end
60126
61127
println("+++ :julia: Running tests")
62-
Pkg.test("Metal"; coverage=true)'
128+
Pkg.test(; coverage=true)'
63129
agents:
64130
queue: "juliaecosystem"
65131
os: "macos"

.github/workflows/ci.yml

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,7 @@ jobs:
2323
with:
2424
version: ${{ matrix.version }}
2525
arch: ${{ matrix.arch }}
26-
- uses: actions/cache@v4
27-
env:
28-
cache-name: cache-artifacts
29-
with:
30-
path: ~/.julia/artifacts
31-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
32-
restore-keys: |
33-
${{ runner.os }}-test-${{ env.cache-name }}-
34-
${{ runner.os }}-test-
35-
${{ runner.os }}-
26+
- uses: julia-actions/cache@v2
3627
- name: Develop subpackages
3728
run: |
3829
julia --project -e "
@@ -49,6 +40,57 @@ jobs:
4940
token: ${{ secrets.CODECOV_TOKEN }}
5041
fail_ci_if_error: false
5142
file: lcov.info
43+
opencl:
44+
name: OpenCL.jl
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: julia-actions/setup-julia@v2
49+
with:
50+
version: '1.10'
51+
arch: x64
52+
- uses: julia-actions/cache@v2
53+
- name: Run tests
54+
run: |
55+
julia -e 'using Pkg
56+
57+
gpuarrays = pwd()
58+
gpuarrayscore = joinpath(gpuarrays, "lib", "GPUArraysCore")
59+
devdir = mktempdir()
60+
package = joinpath(devdir, "OpenCL")
61+
62+
println("--- :julia: Installing TestEnv")
63+
Pkg.activate(; temp=true)
64+
Pkg.add("TestEnv")
65+
using TestEnv
66+
67+
println("--- :julia: Installing OpenCL.jl")
68+
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0,
69+
"JULIA_PKG_DEVDIR" => devdir) do
70+
Pkg.develop("OpenCL")
71+
Pkg.activate(package)
72+
73+
try
74+
Pkg.develop([PackageSpec(path=gpuarrays), PackageSpec(path=gpuarrayscore)])
75+
TestEnv.activate()
76+
catch err
77+
@error "Could not install OpenCL.jl" exception=(err,catch_backtrace())
78+
exit(3)
79+
finally
80+
Pkg.activate(package)
81+
end
82+
end
83+
84+
println("+++ :julia: Running tests")
85+
Pkg.test(; coverage=true)'
86+
- uses: julia-actions/julia-processcoverage@v1
87+
with:
88+
directories: src,lib
89+
- uses: codecov/codecov-action@v4
90+
with:
91+
token: ${{ secrets.CODECOV_TOKEN }}
92+
fail_ci_if_error: false
93+
file: lcov.info
5294
docs:
5395
name: Documentation
5496
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)