Skip to content

Commit e716262

Browse files
authored
Speed up CI (#522)
* Improve matrix skipping * Fix array of strings using fromJSON * Put all tests on same nesting level * Skip pre DIT * Group tests together * Single quote * Deactivate docs * ToJSON * Go back to individual folders * Skip pre * Fix * Test internals first * Reactivate docs
1 parent 0f44787 commit e716262

15 files changed

Lines changed: 73 additions & 89 deletions

File tree

.github/workflows/Test.yml

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -19,63 +19,64 @@ jobs:
1919
test-DI:
2020
name: ${{ matrix.version }} - DI (${{ matrix.group }})
2121
runs-on: ubuntu-latest
22-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'bump') }}
22+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
2323
timeout-minutes: 60
2424
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
2525
actions: write
2626
contents: read
2727
strategy:
28-
fail-fast: false
28+
fail-fast: true
2929
matrix:
3030
version:
3131
- "1"
3232
- "lts"
3333
- "pre"
3434
group:
35-
- Formalities
36-
- Internals
37-
- Back/ChainRulesCore
38-
- Back/Diffractor
35+
- Misc/Internals
36+
- Misc/DifferentiateWith
37+
- Misc/FromPrimitive
38+
- Misc/SparsityDetector
39+
- Misc/ZeroBackends
40+
- Back/ChainRulesBackends
3941
- Back/Enzyme
40-
- Back/FastDifferentiation
4142
- Back/FiniteDiff
4243
- Back/FiniteDifferences
4344
- Back/ForwardDiff
4445
- Back/Mooncake
4546
- Back/PolyesterForwardDiff
4647
- Back/ReverseDiff
4748
- Back/SecondOrder
48-
- Back/Symbolics
49+
- Back/SymbolicBackends
4950
- Back/Tracker
5051
- Back/Zygote
51-
- Misc/DifferentiateWith
52-
- Misc/FromPrimitive
53-
- Misc/SparsityDetector
54-
- Misc/ZeroBackends
5552
- Down/Flux
5653
- Down/Lux
54+
skip_lts:
55+
- ${{ github.event.pull_request.draft }}
56+
skip_pre:
57+
- ${{ github.event.pull_request.draft }}
5758
exclude:
59+
- skip_lts: true
60+
version: "lts"
61+
- skip_pre: true
62+
version: "pre"
5863
# lts
5964
- version: "lts"
60-
group: Formalities
61-
- version: "lts"
62-
group: Back/ChainRulesCore
63-
- version: "lts"
64-
group: Back/Diffractor
65+
group: Back/ChainRulesBackends
6566
- version: "lts"
6667
group: Back/Enzyme
6768
- version: "lts"
6869
group: Back/FiniteDiff
69-
- version: "lts"
70-
group: Back/FastDifferentiation
7170
- version: "lts"
7271
group: Back/Mooncake
7372
- version: "lts"
7473
group: Back/PolyesterForwardDiff
7574
- version: "lts"
7675
group: Back/SecondOrder
7776
- version: "lts"
78-
group: Back/Symbolics
77+
group: Back/SymbolicBackends
78+
- version: "lts"
79+
group: Misc/Internals
7980
- version: "lts"
8081
group: Misc/SparsityDetector
8182
- version: "lts"
@@ -84,44 +85,36 @@ jobs:
8485
group: Down/Lux
8586
# pre-release
8687
- version: "pre"
87-
group: Formalities
88-
- version: "pre"
89-
group: Back/ChainRulesCore
88+
group: Back/ChainRulesBackends
9089
- version: "pre"
9190
group: Back/Enzyme
9291
- version: "pre"
9392
group: Back/Mooncake
9493
- version: "pre"
9594
group: Back/SecondOrder
95+
- version: "pre"
96+
group: Misc/Internals
9697
- version: "pre"
9798
group: Misc/SparsityDetector
9899
env:
99-
SHOULDRUN: ${{ matrix.version == '1' || !github.event.pull_request.draft }}
100100
JULIA_DI_TEST_GROUP: ${{ matrix.group }}
101101
steps:
102-
- run: echo "$SHOULDRUN"
103102
- uses: actions/checkout@v4
104-
if: ${{ env.SHOULDRUN == 'true' }}
105103
- uses: julia-actions/setup-julia@v2
106-
if: ${{ env.SHOULDRUN == 'true' }}
107104
with:
108105
version: ${{ matrix.version }}
109106
arch: x64
110107
- uses: julia-actions/cache@v2
111-
if: ${{ env.SHOULDRUN == 'true' }}
112108
- name: Install dependencies & run tests
113-
if: ${{ env.SHOULDRUN == 'true' }}
114109
# how to add the local DIT to the DI test env?
115110
run: julia --project=./DifferentiationInterface -e '
116111
using Pkg;
117112
Pkg.Registry.update();
118113
Pkg.test("DifferentiationInterface"; coverage=true);'
119114
- uses: julia-actions/julia-processcoverage@v1
120-
if: ${{ env.SHOULDRUN == 'true' }}
121115
with:
122116
directories: ./DifferentiationInterface/src,./DifferentiationInterface/ext,./DifferentiationInterface/test
123117
- uses: codecov/codecov-action@v4
124-
if: ${{ env.SHOULDRUN == 'true' }}
125118
with:
126119
files: lcov.info
127120
flags: DI
@@ -132,13 +125,13 @@ jobs:
132125
test-DIT:
133126
name: ${{ matrix.version }} - DIT (${{ matrix.group }})
134127
runs-on: ubuntu-latest
135-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'bump') }}
128+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
136129
timeout-minutes: 60
137130
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
138131
actions: write
139132
contents: read
140133
strategy:
141-
fail-fast: false
134+
fail-fast: true
142135
matrix:
143136
version:
144137
- "1"
@@ -149,38 +142,38 @@ jobs:
149142
- Zero
150143
- Standard
151144
- Weird
145+
skip_lts:
146+
- ${{ github.event.pull_request.draft }}
147+
skip_pre:
148+
- ${{ github.event.pull_request.draft }}
152149
exclude:
150+
- skip_lts: true
151+
version: "lts"
152+
- skip_pre: true
153+
version: "pre"
153154
- version: "lts"
154155
group: Formalities
155156
- version: "lts"
156157
group: Weird
157158
env:
158-
SHOULDRUN: ${{ matrix.version == '1' || !github.event.pull_request.draft }}
159159
JULIA_DIT_TEST_GROUP: ${{ matrix.group }}
160160
steps:
161-
- run: echo "$SHOULDRUN"
162161
- uses: actions/checkout@v4
163-
if: ${{ env.SHOULDRUN == 'true' }}
164162
- uses: julia-actions/setup-julia@v2
165-
if: ${{ env.SHOULDRUN == 'true' }}
166163
with:
167164
version: ${{ matrix.version }}
168165
arch: x64
169166
- uses: julia-actions/cache@v2
170-
if: ${{ env.SHOULDRUN == 'true' }}
171167
- name: Install dependencies & run tests
172-
if: ${{ env.SHOULDRUN == 'true' }}
173168
run: julia --project=./DifferentiationInterfaceTest -e '
174169
using Pkg;
175170
Pkg.Registry.update();
176171
Pkg.develop(path="./DifferentiationInterface");
177172
Pkg.test("DifferentiationInterfaceTest"; coverage=true);'
178173
- uses: julia-actions/julia-processcoverage@v1
179-
if: ${{ env.SHOULDRUN == 'true' }}
180174
with:
181175
directories: ./DifferentiationInterfaceTest/src,./DifferentiationInterfaceTest/ext,./DifferentiationInterfaceTest/test
182176
- uses: codecov/codecov-action@v4
183-
if: ${{ env.SHOULDRUN == 'true' }}
184177
with:
185178
files: lcov.info
186179
flags: DIT

DifferentiationInterface/test/Back/ChainRulesCore/test.jl renamed to DifferentiationInterface/test/Back/ChainRulesBackends/chainrules_zygote.jl

File renamed without changes.

DifferentiationInterface/test/Back/Diffractor/test.jl renamed to DifferentiationInterface/test/Back/ChainRulesBackends/diffractor.jl

File renamed without changes.

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

File renamed without changes.

DifferentiationInterface/test/Back/Symbolics/test.jl renamed to DifferentiationInterface/test/Back/SymbolicBackends/symbolics.jl

File renamed without changes.

DifferentiationInterface/test/Formalities/aqua.jl

Lines changed: 0 additions & 8 deletions
This file was deleted.

DifferentiationInterface/test/Formalities/jet.jl

Lines changed: 0 additions & 5 deletions
This file was deleted.

DifferentiationInterface/test/Formalities/juliaformatter.jl

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# tested first so that the suite fails quickly
2+
3+
using Aqua: Aqua
4+
using DifferentiationInterface
5+
using JET: JET
6+
using JuliaFormatter: JuliaFormatter
7+
using Test
8+
using SparseMatrixColorings
9+
10+
@testset verbose = true "Formalities" begin
11+
@testset "Aqua" begin
12+
Aqua.test_all(
13+
DifferentiationInterface; ambiguities=false, deps_compat=(check_extras = false)
14+
)
15+
end
16+
@testset "JET" begin
17+
JET.test_package(DifferentiationInterface; target_defined_modules=true)
18+
end
19+
@testset "JuliaFormatter" begin
20+
@test JuliaFormatter.format(
21+
DifferentiationInterface; verbose=false, overwrite=false
22+
)
23+
end
24+
end

DifferentiationInterface/test/Internals/backends.jl renamed to DifferentiationInterface/test/Misc/Internals/backends.jl

File renamed without changes.

0 commit comments

Comments
 (0)