diff --git a/.buildkite/downstream.yml b/.buildkite/downstream.yml index e635ca5e..8d033d8d 100644 --- a/.buildkite/downstream.yml +++ b/.buildkite/downstream.yml @@ -1,5 +1,8 @@ # Tests of the packages that build on GPUCompiler, uploaded by `launch.sh`. # +# The Julia version and the test selection of every step can be changed with the `[julia X]` +# and `[test_args ...]` commit message tags, which `launch.sh` exports for interpolation here. +# # Each step's `if_changed` lists the files that can affect that package: everything in # `src/` and `ext/`, `Project.toml` and the CI configuration, except the other back-ends' # target files. The `if:` conditions implement the commit message tags documented in the @@ -8,7 +11,7 @@ steps: - label: "CUDA.jl" plugins: - JuliaCI/julia#v1: - version: "1.13" + version: "${DOWNSTREAM_JULIA:-1.13}" - JuliaCI/julia-coverage#v1: codecov: true command: | @@ -20,7 +23,7 @@ steps: julia -e 'println("+++ :julia: Running tests") using Pkg - Pkg.test("CUDA"; coverage=true)' + Pkg.test("CUDA"; coverage=true, test_args=split(ENV["DOWNSTREAM_TEST_ARGS"]))' agents: queue: "cuda" if_changed: @@ -42,7 +45,7 @@ steps: - label: "oneAPI.jl" plugins: - JuliaCI/julia#v1: - version: "1.13" + version: "${DOWNSTREAM_JULIA:-1.13}" - JuliaCI/julia-coverage#v1: codecov: true command: | @@ -57,7 +60,7 @@ steps: julia -e 'println("+++ :julia: Running tests") using Pkg - Pkg.test("oneAPI"; coverage=true)' + Pkg.test("oneAPI"; coverage=true, test_args=split(ENV["DOWNSTREAM_TEST_ARGS"]))' agents: queue: "oneapi" if_changed: @@ -75,7 +78,7 @@ steps: - label: "AMDGPU.jl" plugins: - JuliaCI/julia#v1: - version: "1.13" + version: "${DOWNSTREAM_JULIA:-1.13}" - JuliaCI/julia-coverage#v1: codecov: true command: | @@ -86,7 +89,7 @@ steps: julia -e 'println("+++ :julia: Running tests") using Pkg - Pkg.test("AMDGPU"; coverage=true)' + Pkg.test("AMDGPU"; coverage=true, test_args=split(ENV["DOWNSTREAM_TEST_ARGS"]))' agents: queue: "rocm" if_changed: @@ -104,7 +107,7 @@ steps: - label: "Metal.jl" plugins: - JuliaCI/julia#v1: - version: "1.13" + version: "${DOWNSTREAM_JULIA:-1.13}" - JuliaCI/julia-coverage#v1: codecov: true command: | @@ -126,7 +129,7 @@ steps: julia -e 'println("+++ :julia: Running tests") using Pkg - Pkg.test("Metal"; coverage=true)' + Pkg.test("Metal"; coverage=true, test_args=split(ENV["DOWNSTREAM_TEST_ARGS"]))' agents: queue: "metal" if_changed: @@ -144,7 +147,7 @@ steps: - label: "OpenCL.jl" plugins: - JuliaCI/julia#v1: - version: "1.13" + version: "${DOWNSTREAM_JULIA:-1.13}" - JuliaCI/julia-coverage#v1: codecov: true command: | @@ -156,7 +159,7 @@ steps: julia -e 'println("+++ :julia: Running tests") using Pkg - Pkg.test("OpenCL"; coverage=true)' + Pkg.test("OpenCL"; coverage=true, test_args=split(ENV["DOWNSTREAM_TEST_ARGS"]))' agents: # XXX: not on "juliaecosystem" because those workers don't have libc-dev # see JuliaGPU/OpenCL.jl#303 @@ -175,3 +178,5 @@ steps: env: JULIA_PKG_SERVER: "" # it often struggles with our large artifacts + # set by `launch.sh` from the `[test_args ...]` commit message tag + DOWNSTREAM_TEST_ARGS: "${DOWNSTREAM_TEST_ARGS:-}" diff --git a/.buildkite/launch.sh b/.buildkite/launch.sh index 26aab624..4cb944c5 100755 --- a/.buildkite/launch.sh +++ b/.buildkite/launch.sh @@ -15,5 +15,17 @@ elif [[ "${BUILDKITE_MESSAGE:-}" =~ \[(only\ |run\ all\]) ]]; then export BUILDKITE_AGENT_APPLY_IF_CHANGED=false fi +# `[julia X]` and `[test_args ...]` select the Julia version and the tests (passed as +# `test_args` to `Pkg.test`) of the downstream steps, e.g. `[julia nightly]` or +# `[test_args core/codegen gpuarrays/broadcasting]`. +if [[ "${BUILDKITE_MESSAGE:-}" =~ \[julia\ ([^]]+)\] ]]; then + export DOWNSTREAM_JULIA="${BASH_REMATCH[1]}" + echo "Testing downstream packages on Julia $DOWNSTREAM_JULIA" +fi +if [[ "${BUILDKITE_MESSAGE:-}" =~ \[test_args\ ([^]]+)\] ]]; then + export DOWNSTREAM_TEST_ARGS="${BASH_REMATCH[1]}" + echo "Running downstream tests: $DOWNSTREAM_TEST_ARGS" +fi + # fetch the base branch first, as a stale local ref would widen the diff buildkite-agent pipeline upload --fetch-diff-base .buildkite/downstream.yml diff --git a/README.md b/README.md index fc8988a2..f348fb55 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ last commit of a pull request: | `[skip amdgpu]` | Do not test the listed back-ends, even when the changes affect them. | | `[run all]` | Test all back-ends, regardless of the files changed. | | `[skip tests]` | Do not test any back-end. | +| `[julia nightly]` | Test the back-ends on the given Julia version (default: the latest release), e.g. `nightly` or `1.10`. | +| `[test_args core]` | Only run the listed tests of each back-end, passed as `test_args` to `Pkg.test`, e.g. `[test_args core/codegen gpuarrays/broadcasting]`. | Back-ends are named `cuda`, `amdgpu`, `metal`, `oneapi` and `opencl` (all lowercase), or by their target: `ptx` for CUDA.jl, `gcn` for AMDGPU.jl, and `spirv` for both oneAPI.jl and