Skip to content

Use ParallelTestRunner #579

Use ParallelTestRunner

Use ParallelTestRunner #579

Workflow file for this run

name: Test
on:
push:
branches: [master]
tags: ["*"]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.memory_backend }} - PoCL ${{ matrix.pocl }}
runs-on: ${{ matrix.os }}
timeout-minutes: 400
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
version: ['1.10', '1.12']
os: [ubuntu-24.04, ubuntu-24.04-arm, macOS-15-intel, windows-2022]
arch: [x64, arm64]
pocl: [jll, local]
memory_backend: [usm, svm, buffer]
exclude:
# unsupported combinations
- os: ubuntu-24.04
arch: arm64
- os: windows-2022
arch: arm64
- os: ubuntu-24.04-arm
arch: x64
# macOS-15-intel is Intel-only
- os: macOS-15-intel
arch: arm64
# we only test building PoCL on Linux
- os: macOS-15-intel
pocl: local
- os: windows-2022
pocl: local
steps:
- name: Checkout OpenCL.jl
uses: actions/checkout@v6
- name: Setup Julia
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- name: Setup Julia cache
uses: julia-actions/cache@v2
- name: Checkout PoCL
if: ${{ matrix.pocl == 'local' }}
uses: actions/checkout@v6
with:
repository: pocl/pocl
path: pocl
- name: Install system dependencies
if: ${{ matrix.pocl == 'local' }}
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build pkg-config
- name: Install Julia dependencies
if: ${{ matrix.pocl == 'local' }}
run: |
touch pocl/Project.toml
julia --project=pocl --color=yes -e '
using Pkg
# unversioned
Pkg.add([
"SPIRV_Tools_jll",
"OpenCL_jll",
"OpenCL_Headers_jll",
"Hwloc_jll",
"CMake_jll",
])
# versioned
Pkg.add(name="LLVM_full_jll", version="20")
Pkg.add(name="SPIRV_LLVM_Translator_jll", version="20")'
- name: Build PoCL
if: ${{ matrix.pocl == 'local' }}
run: |
julia --project=pocl --color=yes -e '
using LLVM_full_jll,
SPIRV_Tools_jll, SPIRV_LLVM_Translator_jll,
OpenCL_jll, OpenCL_Headers_jll, CMake_jll
sourcedir = joinpath(@__DIR__, "pocl")
builddir = joinpath(@__DIR__, "build")
destdir = joinpath(@__DIR__, "target")
prefix = []
for jll in [SPIRV_Tools_jll, SPIRV_LLVM_Translator_jll,
OpenCL_jll, OpenCL_Headers_jll]
push!(prefix, jll.artifact_dir)
end
withenv("LD_LIBRARY_PATH" => joinpath(Sys.BINDIR, Base.PRIVATE_LIBDIR)) do
mkpath(builddir)
run(```cmake -B $builddir -S $sourcedir
-GNinja
-DCMAKE_BUILD_TYPE=Debug
-DENABLE_TESTS:Bool=OFF
-DSTATIC_LLVM:Bool=On
-DCMAKE_INSTALL_PREFIX=$destdir
-DWITH_LLVM_CONFIG=$(LLVM_full_jll.artifact_dir)/tools/llvm-config
-DCMAKE_PREFIX_PATH="$(join(prefix, ";"))"
-DKERNELLIB_HOST_CPU_VARIANTS=distro```)
run(```$(cmake()) --build $builddir --parallel $(Sys.CPU_THREADS) --target install```)
end'
echo '[pocl_jll]' >> test/LocalPreferences.toml
echo 'libpocl_path="${{ github.workspace }}/target/lib/libpocl.so"' >> test/LocalPreferences.toml
- name: Setup OpenCL.jl
run: |
echo '[OpenCL]' >> test/LocalPreferences.toml
echo 'default_memory_backend="${{ matrix.memory_backend }}"' >> test/LocalPreferences.toml
julia --project -e '
using Pkg
Pkg.develop(path="lib/intrinsics")'
- name: Test OpenCL.jl
uses: julia-actions/julia-runtest@v1
if: runner.os != 'Windows'
with:
test_args: '--quickfail --platform=pocl'
- name: Setup BusyBox
if: runner.os == 'Windows'
run: |
Invoke-WebRequest https://frippery.org/files/busybox/busybox64.exe -OutFile C:\Windows\drop.exe
- name: Test OpenCL.jl (de-escalated)
if: runner.os == 'Windows'
shell: drop -c "julia '{0}'"
run: |
using Pkg
Pkg.activate(".")
Pkg.test(; test_args=`--quickfail --platform=pocl`)
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info