Skip to content

Commit 1b5d91c

Browse files
authored
chore: clean up backend testing CI (#1002)
* chore: add Pkg sources to test envs, switch draft backend testing to -O1 * Skip correct version
1 parent 5a3ea38 commit 1b5d91c

16 files changed

Lines changed: 94 additions & 52 deletions

File tree

.github/workflows/Test.yml

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
push:
55
branches:
66
- main
7-
tags: ['*']
7+
tags: [ '*' ]
88
pull_request:
9-
types: [opened, reopened, synchronize, ready_for_review]
9+
types: [ opened, reopened, synchronize, ready_for_review ]
1010
workflow_dispatch:
1111

1212
concurrency:
@@ -21,7 +21,8 @@ jobs:
2121
runs-on: ubuntu-latest
2222
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
2323
timeout-minutes: 180
24-
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
24+
permissions:
25+
# needed to allow julia-actions/cache to proactively delete old caches that it has created
2526
actions: write
2627
contents: read
2728
strategy:
@@ -35,15 +36,13 @@ jobs:
3536
- Internals
3637
- SimpleFiniteDiff
3738
- ZeroBackends
38-
skip_lts:
39-
- ${{ github.event.pull_request.draft }}
40-
skip_pre:
39+
skip_past:
4140
- ${{ github.event.pull_request.draft }}
4241
exclude:
43-
- skip_lts: true
42+
- skip_past: true
4443
version: '1.10'
45-
- skip_pre: true
46-
version: '1.12'
44+
- skip_past: true
45+
version: '1.11'
4746
env:
4847
JULIA_DI_TEST_TYPE: 'Core'
4948
JULIA_DI_TEST_GROUP: ${{ matrix.group }}
@@ -56,22 +55,15 @@ jobs:
5655
arch: x64
5756
- uses: julia-actions/cache@v3
5857
- name: Install dependencies & run tests
59-
run: julia --color=yes -e '
60-
using Pkg;
61-
Pkg.activate("./DifferentiationInterface/test");
62-
if VERSION < v"1.11";
63-
Pkg.rm("DifferentiationInterfaceTest");
64-
Pkg.resolve();
65-
else;
66-
Pkg.develop(; path="./DifferentiationInterfaceTest");
67-
end;
68-
Pkg.activate("./DifferentiationInterface");
69-
test_kwargs = (; allow_reresolve=false, coverage=true);
70-
if ENV["JULIA_DI_PR_DRAFT"] == "true";
71-
Pkg.test("DifferentiationInterface"; julia_args=["-O1"], test_kwargs...);
72-
else;
73-
Pkg.test("DifferentiationInterface"; test_kwargs...);
74-
end;'
58+
run: julia --color=yes -e ' using Pkg;
59+
Pkg.activate("./DifferentiationInterface/test"); if VERSION < v"1.11";
60+
Pkg.rm("DifferentiationInterfaceTest"); Pkg.resolve(); else;
61+
Pkg.develop(; path="./DifferentiationInterfaceTest"); end;
62+
Pkg.activate("./DifferentiationInterface"); test_kwargs = (;
63+
allow_reresolve=false, coverage=true); if ENV["JULIA_DI_PR_DRAFT"] ==
64+
"true"; Pkg.test("DifferentiationInterface"; julia_args=["-O1"],
65+
test_kwargs...); else; Pkg.test("DifferentiationInterface";
66+
test_kwargs...); end;'
7567
- uses: julia-actions/julia-processcoverage@v1
7668
with:
7769
directories: ./DifferentiationInterface/src,./DifferentiationInterface/ext,./DifferentiationInterface/test
@@ -87,7 +79,8 @@ jobs:
8779
runs-on: ubuntu-latest
8880
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
8981
timeout-minutes: 120
90-
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
82+
permissions:
83+
# needed to allow julia-actions/cache to proactively delete old caches that it has created
9184
actions: write
9285
contents: read
9386
strategy:
@@ -114,15 +107,13 @@ jobs:
114107
- Symbolics
115108
- Tracker
116109
- Zygote
117-
skip_lts:
118-
- ${{ github.event.pull_request.draft }}
119-
skip_pre:
110+
skip_past:
120111
- ${{ github.event.pull_request.draft }}
121112
exclude:
122-
- skip_lts: true
113+
- skip_past: true
123114
version: '1.10'
124-
- skip_pre: true
125-
version: '1.12'
115+
- skip_past: true
116+
version: '1.11'
126117
- version: '1.11'
127118
group: ChainRules
128119
env:
@@ -136,12 +127,21 @@ jobs:
136127
version: ${{ matrix.version }}
137128
arch: x64
138129
- uses: julia-actions/cache@v3
139-
- name: Install dependencies & run tests
140-
run: julia --code-coverage=user --color=yes -e '
141-
using Pkg;
142-
group = ENV["JULIA_DI_TEST_GROUP"];
130+
- name: Install dependencies & run tests (draft)
131+
if: ${{ github.event.pull_request.draft }}
132+
run: julia --code-coverage=user --color=yes -e ' using Pkg; group =
133+
ENV["JULIA_DI_TEST_GROUP"];
143134
Pkg.activate("./DifferentiationInterface/test/Back/$group");
144-
Pkg.develop([PackageSpec(path="./DifferentiationInterface"), PackageSpec(path="./DifferentiationInterfaceTest")]);
135+
Pkg.develop([PackageSpec(path="./DifferentiationInterface"),
136+
PackageSpec(path="./DifferentiationInterfaceTest")]);
137+
include("./DifferentiationInterface/test/Back/run_backend.jl");'
138+
- name: Install dependencies & run tests (not draft)
139+
if: ${{ github.event.pull_request.draft }}
140+
run: julia -O1 --code-coverage=user --color=yes -e ' using Pkg; group =
141+
ENV["JULIA_DI_TEST_GROUP"];
142+
Pkg.activate("./DifferentiationInterface/test/Back/$group");
143+
Pkg.develop([PackageSpec(path="./DifferentiationInterface"),
144+
PackageSpec(path="./DifferentiationInterfaceTest")]);
145145
include("./DifferentiationInterface/test/Back/run_backend.jl");'
146146
- uses: julia-actions/julia-processcoverage@v1
147147
with:
@@ -158,7 +158,8 @@ jobs:
158158
runs-on: ubuntu-latest
159159
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
160160
timeout-minutes: 60
161-
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
161+
permissions:
162+
# needed to allow julia-actions/cache to proactively delete old caches that it has created
162163
actions: write
163164
contents: read
164165
strategy:
@@ -173,15 +174,13 @@ jobs:
173174
- Zero
174175
- Standard
175176
- Weird
176-
skip_lts:
177-
- ${{ github.event.pull_request.draft }}
178-
skip_pre:
177+
skip_past:
179178
- ${{ github.event.pull_request.draft }}
180179
exclude:
181-
- skip_lts: true
180+
- skip_past: true
182181
version: '1.10'
183-
- skip_pre: true
184-
version: '1.12'
182+
- skip_past: true
183+
version: '1.11'
185184
env:
186185
JULIA_DIT_TEST_GROUP: ${{ matrix.group }}
187186
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
@@ -193,15 +192,13 @@ jobs:
193192
arch: x64
194193
- uses: julia-actions/cache@v3
195194
- name: Install dependencies & run tests
196-
run: julia --project=./DifferentiationInterfaceTest --color=yes -e '
197-
using Pkg;
198-
Pkg.Registry.update();
199-
Pkg.develop(path="./DifferentiationInterface");
195+
run: julia --project=./DifferentiationInterfaceTest --color=yes -e ' using Pkg;
196+
Pkg.Registry.update(); Pkg.develop(path="./DifferentiationInterface");
200197
if ENV["JULIA_DI_PR_DRAFT"] == "true";
201-
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false, coverage=true, julia_args=["-O1"]);
202-
else;
203-
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false, coverage=true);
204-
end;'
198+
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false,
199+
coverage=true, julia_args=["-O1"]); else;
200+
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false,
201+
coverage=true); end;'
205202
- uses: julia-actions/julia-processcoverage@v1
206203
with:
207204
directories: ./DifferentiationInterfaceTest/src,./DifferentiationInterfaceTest/ext,./DifferentiationInterfaceTest/test

DifferentiationInterface/test/Back/ChainRules/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
88
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
99
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1010
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
11+
12+
[sources]
13+
DifferentiationInterface = { path = "../../.." }

DifferentiationInterface/test/Back/DifferentiateWith/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
1212
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
1313
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1414
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
15+
16+
[sources]
17+
DifferentiationInterface = { path = "../../.." }

DifferentiationInterface/test/Back/Enzyme/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
99
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
1010
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1111
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
12+
13+
[sources]
14+
DifferentiationInterface = { path = "../../.." }

DifferentiationInterface/test/Back/FastDifferentiation/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
88
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
99
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
1010
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
11+
12+
[sources]
13+
DifferentiationInterface = { path = "../../.." }

DifferentiationInterface/test/Back/FiniteDiff/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
99
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
1010
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
1111
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
12+
13+
[sources]
14+
DifferentiationInterface = { path = "../../.." }

DifferentiationInterface/test/Back/FiniteDifferences/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
77
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
88
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
99
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
10+
11+
[sources]
12+
DifferentiationInterface = { path = "../../.." }

DifferentiationInterface/test/Back/ForwardDiff/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
1313
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
1414
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1515
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
16+
17+
[sources]
18+
DifferentiationInterface = { path = "../../.." }

DifferentiationInterface/test/Back/GTPSA/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
88
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
99
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
1010
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
11+
12+
[sources]
13+
DifferentiationInterface = { path = "../../.." }

DifferentiationInterface/test/Back/Mooncake/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
88
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
99
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1010
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
11+
12+
[sources]
13+
DifferentiationInterface = { path = "../../.." }

0 commit comments

Comments
 (0)