Skip to content

Commit 63f85a6

Browse files
committed
ci: setup integration testing
1 parent 4970a85 commit 63f85a6

File tree

10 files changed

+104
-34
lines changed

10 files changed

+104
-34
lines changed

.github/workflows/CI.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,13 @@ jobs:
6262
os: ${{ matrix.os }}
6363
runtime: ${{ matrix.runtime }}
6464

65-
# This has been broken for a while, originating from Enzyme.jl
66-
# test-assertions:
67-
# strategy:
68-
# fail-fast: false
69-
# matrix:
70-
# version:
71-
# - "1.10"
72-
# uses: ./.github/workflows/CommonCI.yml
73-
# with:
74-
# julia_version: ${{ matrix.version }}
75-
# os: "ubuntu-24.04"
76-
# runtime: "both"
77-
# assertions: true
65+
test-assertions:
66+
uses: ./.github/workflows/CommonCI.yml
67+
with:
68+
julia_version: "1.10"
69+
os: "ubuntu-24.04"
70+
runtime: "both"
71+
assertions: true
7872

7973
downgrade:
8074
strategy:

.github/workflows/CommonCI.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ on:
3535
required: false
3636
default: false
3737
type: boolean
38+
project:
39+
description: "Project"
40+
required: false
41+
default: "."
42+
type: string
3843

3944
jobs:
4045
test:
@@ -130,11 +135,24 @@ jobs:
130135
end
131136
Pkg.develop(dev_pks)
132137
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0}
133-
# Only in Julia v1.10 we need to install `ReactantCore` manually.
134138
if: ${{ inputs.julia_version == '1.10' || inputs.julia_version == 'lts' }}
135139
env:
136140
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
137141

142+
- name: Install Project
143+
if: ${{ inputs.project != '.' }}
144+
run: |
145+
import Pkg
146+
PKg.activate(get(ENV, "JULIA_PROJECT", nothing))
147+
if VERSION < v"1.11-"
148+
Pkg.develop([PackageSpec(; path="."), PackageSpec(; path="lib/ReactantCore")])
149+
end
150+
Pkg.instantiate()
151+
shell: julia --color=yes --code-coverage=user --depwarn=yes {0}
152+
env:
153+
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
154+
JULIA_PROJECT: ${{ inputs.project }}
155+
138156
# Run the tests (pjrt or ifrt or both)
139157
- name: "Setup Runtime Preferences (PJRT)"
140158
if: ${{ inputs.runtime == 'pjrt' || inputs.runtime == 'both' }}
@@ -145,8 +163,9 @@ jobs:
145163
contents: |
146164
[Reactant]
147165
xla_runtime = "PJRT"
166+
148167
- name: "Run Tests (PJRT)"
149-
if: ${{ inputs.runtime == 'pjrt' || inputs.runtime == 'both' }}
168+
if: ${{ (inputs.runtime == 'pjrt' || inputs.runtime == 'both') && inputs.project == '.' }}
150169
timeout-minutes: 60
151170
run: |
152171
import Pkg
@@ -162,6 +181,14 @@ jobs:
162181
REACTANT_TEST_GROUP: ${{ inputs.test_group }}
163182
XLA_FLAGS: "--xla_force_host_platform_device_count=12"
164183
JULIA_DEBUG: "Reactant,Reactant_jll"
184+
- name: "Run Integration Tests (PJRT)"
185+
if: ${{ (inputs.runtime == 'pjrt' || inputs.runtime == 'both') && inputs.project != '.' }}
186+
timeout-minutes: 30
187+
run: julia --color=yes --project=test/integration/${{ inputs.project }} --threads=auto --check-bounds=yes -O1 test/integration/${{ inputs.project }}/runtests.jl
188+
shell: bash
189+
env:
190+
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
191+
JULIA_DEBUG: "Reactant,Reactant_jll"
165192

166193
- name: "Setup Runtime Preferences (IFRT)"
167194
if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }}
@@ -172,8 +199,9 @@ jobs:
172199
contents: |
173200
[Reactant]
174201
xla_runtime = "IFRT"
202+
175203
- name: "Run Tests (IFRT)"
176-
if: ${{ inputs.runtime == 'ifrt' || inputs.runtime == 'both' }}
204+
if: ${{ (inputs.runtime == 'ifrt' || inputs.runtime == 'both') && inputs.projec == '.' }}
177205
timeout-minutes: 60
178206
run: |
179207
import Pkg
@@ -189,6 +217,14 @@ jobs:
189217
REACTANT_TEST_GROUP: ${{ inputs.test_group }}
190218
XLA_FLAGS: "--xla_force_host_platform_device_count=12"
191219
JULIA_DEBUG: "Reactant,Reactant_jll"
220+
- name: "Run Integration Tests (IFRT)"
221+
if: ${{ (inputs.runtime == 'ifrt' || inputs.runtime == 'both') && inputs.project != '.' }}
222+
timeout-minutes: 30
223+
run: julia --color=yes --project=test/integration/${{ inputs.project }} --threads=auto --check-bounds=yes -O1 test/integration/${{ inputs.project }}/runtests.jl
224+
shell: bash
225+
env:
226+
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
227+
JULIA_DEBUG: "Reactant,Reactant_jll"
192228

193229
- name: "Upload MLIR modules"
194230
uses: actions/upload-artifact@v4

.github/workflows/Integration.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Integration
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/Integration.yml"
7+
- "ext/**"
8+
- "lib/**"
9+
- "src/**"
10+
- "test/**"
11+
- "Project.toml"
12+
push:
13+
branches:
14+
- main
15+
- release-*
16+
tags: ["*"]
17+
paths:
18+
- ".github/workflows/Integration.yml"
19+
- "ext/**"
20+
- "lib/**"
21+
- "src/**"
22+
- "test/**"
23+
- "Project.toml"
24+
25+
concurrency:
26+
# Skip intermediate builds: always.
27+
# Cancel intermediate builds: only if it is a pull request build.
28+
group: ${{ github.workflow }}-${{ github.ref }}
29+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
30+
31+
jobs:
32+
integration:
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
project:
37+
- CUDA
38+
- FancyArrayTypes
39+
- FFT
40+
- Flux
41+
- Lux
42+
- NNlib
43+
- Python
44+
version:
45+
- "1.10"
46+
- "1.11"
47+
os:
48+
- ubuntu-latest
49+
- linux-x86-ct6e-180-4tpu
50+
uses: ./.github/workflows/CommonCI.yml
51+
with:
52+
julia_version: ${{ matrix.version }}
53+
os: ${{ matrix.os }}
54+
runtime: "both"
55+
project: "test/integration/${{ matrix.project }}"

test/integration/CUDA/Project.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
66

77
[sources]
88
Reactant = {path = "../../.."}
9-
10-
[extras]
11-
Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0"

test/integration/FFT/Project.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
55

66
[sources]
77
Reactant = {path = "../../.."}
8-
9-
[extras]
10-
Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0"

test/integration/FancyArrayTypes/Project.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
88

99
[sources]
1010
Reactant = {path = "../../.."}
11-
12-
[extras]
13-
Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0"

test/integration/Flux/Project.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
66

77
[sources]
88
Reactant = {path = "../../.."}
9-
10-
[extras]
11-
Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0"

test/integration/Lux/Project.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,3 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1313

1414
[sources]
1515
Reactant = {path = "../../.."}
16-
17-
[extras]
18-
Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0"

test/integration/NNlib/Project.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
66

77
[sources]
88
Reactant = {path = "../../.."}
9-
10-
[extras]
11-
Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0"

test/integration/Python/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
33
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
44
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5+
6+
[sources]
7+
Reactant = {path = "../../.."}

0 commit comments

Comments
 (0)