Skip to content

Commit 3f4c2de

Browse files
authored
chore: revamp testing CI with dedicated environments (#926)
* chore: revamp testing CI with dedicated environments * Typo * Single Pkg.add * Remove registry updates * Update Test.yml * Update Test.yml * Fixes * Fix 1.10 * Fix * Fixes
1 parent e40ad46 commit 3f4c2de

File tree

43 files changed

+295
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+295
-163
lines changed

.github/workflows/Test.yml

Lines changed: 81 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ concurrency:
1616
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1717

1818
jobs:
19-
test-DI:
20-
name: ${{ matrix.version }} - DI (${{ matrix.group }})
19+
test-DI-Core:
20+
name: ${{ matrix.version }} - DI Core (${{ matrix.group }})
2121
runs-on: ubuntu-latest
2222
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
2323
timeout-minutes: 120
@@ -32,25 +32,9 @@ jobs:
3232
- '1.11'
3333
- '1.12'
3434
group:
35-
- Core/Internals
36-
- Back/DifferentiateWith
37-
- Core/SimpleFiniteDiff
38-
- Back/SparsityDetector
39-
- Core/ZeroBackends
40-
- Back/ChainRules
41-
# - Back/Diffractor
42-
- Back/Enzyme
43-
- Back/FastDifferentiation
44-
- Back/FiniteDiff
45-
- Back/FiniteDifferences
46-
- Back/ForwardDiff
47-
- Back/GTPSA
48-
- Back/Mooncake
49-
- Back/PolyesterForwardDiff
50-
- Back/ReverseDiff
51-
- Back/Symbolics
52-
- Back/Tracker
53-
- Back/Zygote
35+
- Internals
36+
- SimpleFiniteDiff
37+
- ZeroBackends
5438
skip_lts:
5539
- ${{ github.event.pull_request.draft }}
5640
skip_pre:
@@ -60,13 +44,8 @@ jobs:
6044
version: '1.10'
6145
- skip_pre: true
6246
version: '1.12'
63-
- version: '1.11'
64-
group: Back/ChainRules
65-
- version: '1.12'
66-
group: Back/Enzyme
67-
- version: '1.12'
68-
group: Back/DifferentiateWith
6947
env:
48+
JULIA_DI_TEST_TYPE: 'Core'
7049
JULIA_DI_TEST_GROUP: ${{ matrix.group }}
7150
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
7251
steps:
@@ -79,7 +58,6 @@ jobs:
7958
- name: Install dependencies & run tests
8059
run: julia --color=yes -e '
8160
using Pkg;
82-
Pkg.Registry.update();
8361
Pkg.activate("./DifferentiationInterface/test");
8462
if VERSION < v"1.11";
8563
Pkg.rm("DifferentiationInterfaceTest");
@@ -104,6 +82,81 @@ jobs:
10482
token: ${{ secrets.CODECOV_TOKEN }}
10583
fail_ci_if_error: false
10684

85+
test-DI-Backend:
86+
name: ${{ matrix.version }} - DI Back (${{ matrix.group }})
87+
runs-on: ubuntu-latest
88+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
89+
timeout-minutes: 120
90+
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
91+
actions: write
92+
contents: read
93+
strategy:
94+
fail-fast: false # TODO: toggle
95+
matrix:
96+
version:
97+
- '1.10'
98+
- '1.11'
99+
- '1.12'
100+
group:
101+
- ChainRules
102+
- DifferentiateWith
103+
# - Diffractor
104+
- Enzyme
105+
- FastDifferentiation
106+
- FiniteDiff
107+
- FiniteDifferences
108+
- ForwardDiff
109+
- GTPSA
110+
- Mooncake
111+
- PolyesterForwardDiff
112+
- ReverseDiff
113+
- SparsityDetector
114+
- Symbolics
115+
- Tracker
116+
- Zygote
117+
skip_lts:
118+
- ${{ github.event.pull_request.draft }}
119+
skip_pre:
120+
- ${{ github.event.pull_request.draft }}
121+
exclude:
122+
- skip_lts: true
123+
version: '1.10'
124+
- skip_pre: true
125+
version: '1.12'
126+
- version: '1.11'
127+
group: ChainRules
128+
- version: '1.12'
129+
group: Enzyme
130+
- version: '1.12'
131+
group: DifferentiateWith
132+
env:
133+
JULIA_DI_TEST_TYPE: 'Back'
134+
JULIA_DI_TEST_GROUP: ${{ matrix.group }}
135+
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
136+
steps:
137+
- uses: actions/checkout@v5
138+
- uses: julia-actions/setup-julia@v2
139+
with:
140+
version: ${{ matrix.version }}
141+
arch: x64
142+
- uses: julia-actions/cache@v2
143+
- name: Install dependencies & run tests
144+
run: julia --code-coverage=user --color=yes -e '
145+
using Pkg;
146+
group = ENV["JULIA_DI_TEST_GROUP"];
147+
Pkg.activate("./DifferentiationInterface/test/Back/$group");
148+
Pkg.develop([PackageSpec(path="./DifferentiationInterface"), PackageSpec(path="./DifferentiationInterfaceTest")]);
149+
include("./DifferentiationInterface/test/Back/run_backend.jl");'
150+
- uses: julia-actions/julia-processcoverage@v1
151+
with:
152+
directories: ./DifferentiationInterface/src,./DifferentiationInterface/ext,./DifferentiationInterface/test
153+
- uses: codecov/codecov-action@v5
154+
with:
155+
files: lcov.info
156+
flags: DI
157+
token: ${{ secrets.CODECOV_TOKEN }}
158+
fail_ci_if_error: false
159+
107160
test-DIT:
108161
name: ${{ matrix.version }} - DIT (${{ matrix.group }})
109162
runs-on: ubuntu-latest
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[deps]
2+
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
3+
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
4+
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
5+
DifferentiationInterfaceTest = "a82114a7-5aa3-49a8-9643-716bb13727a3"
6+
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
7+
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
8+
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
9+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
10+
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

DifferentiationInterface/test/Back/ChainRules/zygote.jl renamed to DifferentiationInterface/test/Back/ChainRules/test.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
using Pkg
2-
Pkg.add(["ChainRulesCore", "Zygote"])
1+
include("../../testutils.jl")
32

4-
using ChainRulesCore
53
using DifferentiationInterface, DifferentiationInterfaceTest
64
using Test
75
using Zygote: ZygoteRuleConfig
86

97
using ExplicitImports
108
check_no_implicit_imports(DifferentiationInterface)
119

12-
LOGGING = get(ENV, "CI", "false") == "false"
13-
1410
for backend in [AutoChainRules(ZygoteRuleConfig())]
1511
@test check_available(backend)
1612
@test !check_inplace(backend)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[deps]
2+
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
3+
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
4+
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
5+
DifferentiationInterfaceTest = "a82114a7-5aa3-49a8-9643-716bb13727a3"
6+
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
7+
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
8+
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
9+
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
10+
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
11+
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
12+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
13+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
14+
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

DifferentiationInterface/test/Back/DifferentiateWith/test.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Pkg
2-
Pkg.add(["ChainRulesTestUtils", "FiniteDiff", "ForwardDiff", "Zygote", "Mooncake"])
1+
include("../../testutils.jl")
32

43
using ChainRulesTestUtils: ChainRulesTestUtils
54
using DifferentiationInterface, DifferentiationInterfaceTest
@@ -11,8 +10,6 @@ using Mooncake: Mooncake
1110
using StableRNGs
1211
using Test
1312

14-
LOGGING = get(ENV, "CI", "false") == "false"
15-
1613
struct ADBreaker{F}
1714
f::F
1815
end

DifferentiationInterface/test/Back/Diffractor/test.jl

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[deps]
2+
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
3+
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
4+
DifferentiationInterfaceTest = "a82114a7-5aa3-49a8-9643-716bb13727a3"
5+
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
6+
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
7+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
8+
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
9+
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
10+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
11+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

DifferentiationInterface/test/Back/Enzyme/test.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# see https://github.com/JuliaDiff/DifferentiationInterface.jl/issues/855
2-
3-
using Pkg
4-
Pkg.add("Enzyme")
1+
include("../../testutils.jl")
52

63
using ADTypes: ADTypes
74
using DifferentiationInterface, DifferentiationInterfaceTest
@@ -14,8 +11,6 @@ using Test
1411
using ExplicitImports
1512
check_no_implicit_imports(DifferentiationInterface)
1613

17-
LOGGING = get(ENV, "CI", "false") == "false"
18-
1914
backends = [
2015
AutoEnzyme(; mode = nothing),
2116
AutoEnzyme(; mode = Enzyme.Forward),
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[deps]
2+
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
3+
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
4+
DifferentiationInterfaceTest = "a82114a7-5aa3-49a8-9643-716bb13727a3"
5+
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
6+
FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be"
7+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
8+
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
9+
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
10+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

DifferentiationInterface/test/Back/FastDifferentiation/fastdifferentiation.jl renamed to DifferentiationInterface/test/Back/FastDifferentiation/test.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Pkg
2-
Pkg.add("FastDifferentiation")
1+
include("../../testutils.jl")
32

43
using DifferentiationInterface, DifferentiationInterfaceTest
54
using SparseMatrixColorings
@@ -10,8 +9,6 @@ using Test
109
using ExplicitImports
1110
check_no_implicit_imports(DifferentiationInterface)
1211

13-
LOGGING = get(ENV, "CI", "false") == "false"
14-
1512
for backend in [AutoFastDifferentiation(), AutoSparse(AutoFastDifferentiation())]
1613
@test check_available(backend)
1714
@test check_inplace(backend)

0 commit comments

Comments
 (0)