Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenCL.jl to CI. #563

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 83 additions & 17 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,35 @@ steps:
command: |
julia -e 'using Pkg

println("--- :julia: Instantiating project")
Pkg.develop(; path=pwd())
Pkg.develop(; name="CUDA")
gpuarrays = pwd()
gpuarrayscore = joinpath(gpuarrays, "lib", "GPUArraysCore")
devdir = mktempdir()
package = joinpath(devdir, "CUDA")

println("--- :julia: Installing TestEnv")
Pkg.activate(; temp=true)
Pkg.add("TestEnv")
using TestEnv

println("--- :julia: Installing CUDA.jl")
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0,
"JULIA_PKG_DEVDIR" => devdir) do
Pkg.develop("CUDA")
Pkg.activate(package)

try
Pkg.develop([PackageSpec(path=gpuarrays), PackageSpec(path=gpuarrayscore)])
TestEnv.activate()
catch err
@error "Could not install CUDA.jl" exception=(err,catch_backtrace())
exit(3)
finally
Pkg.activate(package)
end
end

println("+++ :julia: Running tests")
Pkg.test("CUDA"; coverage=true)'
Pkg.test(; coverage=true)'
agents:
queue: "juliagpu"
cuda: "*"
Expand All @@ -27,18 +50,38 @@ steps:
- JuliaCI/julia-coverage#v1:
codecov: true
command: |
julia -e 'using Pkg;
julia -e 'using Pkg

gpuarrays = pwd()
gpuarrayscore = joinpath(gpuarrays, "lib", "GPUArraysCore")
devdir = mktempdir()
package = joinpath(devdir, "oneAPI")

println("--- :julia: Instantiating project")
Pkg.develop(; path=pwd())
Pkg.develop(; name="oneAPI")
println("--- :julia: Installing TestEnv")
Pkg.activate(; temp=true)
Pkg.add("TestEnv")
using TestEnv

println("+++ :julia: Building support library")
include(joinpath(Pkg.devdir(), "oneAPI", "deps", "build_ci.jl"))
Pkg.activate()
println("--- :julia: Installing oneAPI.jl")
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0,
"JULIA_PKG_DEVDIR" => devdir) do
Pkg.develop("oneAPI")
include(joinpath(package, "deps", "build_ci.jl"))
Pkg.activate(package)

try
Pkg.develop([PackageSpec(path=gpuarrays), PackageSpec(path=gpuarrayscore)])
TestEnv.activate()
catch err
@error "Could not install oneAPI.jl" exception=(err,catch_backtrace())
exit(3)
finally
Pkg.activate(package)
end
end

println("+++ :julia: Running tests")
Pkg.test("oneAPI"; coverage=true)'
Pkg.test(; coverage=true)'
agents:
queue: "juliagpu"
intel: "*"
Expand All @@ -52,14 +95,37 @@ steps:
- JuliaCI/julia-coverage#v1:
codecov: true
command: |
julia -e 'using Pkg;
julia -e 'using Pkg

gpuarrays = pwd()
gpuarrayscore = joinpath(gpuarrays, "lib", "GPUArraysCore")
devdir = mktempdir()
package = joinpath(devdir, "Metal")

println("--- :julia: Installing TestEnv")
Pkg.activate(; temp=true)
Pkg.add("TestEnv")
using TestEnv

println("--- :julia: Installing Metal.jl")
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0,
"JULIA_PKG_DEVDIR" => devdir) do
Pkg.develop("Metal")
Pkg.activate(package)

println("--- :julia: Instantiating project")
Pkg.develop(; path=pwd())
Pkg.develop(; name="Metal")
try
Pkg.develop([PackageSpec(path=gpuarrays), PackageSpec(path=gpuarrayscore)])
TestEnv.activate()
catch err
@error "Could not install Metal.jl" exception=(err,catch_backtrace())
exit(3)
finally
Pkg.activate(package)
end
end

println("+++ :julia: Running tests")
Pkg.test("Metal"; coverage=true)'
Pkg.test(; coverage=true)'
agents:
queue: "juliaecosystem"
os: "macos"
Expand Down
62 changes: 52 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v2
- name: Develop subpackages
run: |
julia --project -e "
Expand All @@ -49,6 +40,57 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
file: lcov.info
opencl:
name: OpenCL.jl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1.10'
arch: x64
- uses: julia-actions/cache@v2
- name: Run tests
run: |
julia -e 'using Pkg

gpuarrays = pwd()
gpuarrayscore = joinpath(gpuarrays, "lib", "GPUArraysCore")
devdir = mktempdir()
package = joinpath(devdir, "OpenCL")

println("--- :julia: Installing TestEnv")
Pkg.activate(; temp=true)
Pkg.add("TestEnv")
using TestEnv

println("--- :julia: Installing OpenCL.jl")
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0,
"JULIA_PKG_DEVDIR" => devdir) do
Pkg.develop("OpenCL")
Pkg.activate(package)

try
Pkg.develop([PackageSpec(path=gpuarrays), PackageSpec(path=gpuarrayscore)])
TestEnv.activate()
catch err
@error "Could not install OpenCL.jl" exception=(err,catch_backtrace())
exit(3)
finally
Pkg.activate(package)
end
end

println("+++ :julia: Running tests")
Pkg.test(; coverage=true)'
- uses: julia-actions/julia-processcoverage@v1
with:
directories: src,lib
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
Expand Down
Loading