Skip to content

Commit a3ad48c

Browse files
committed
chore: add Pkg sources to test envs, switch draft backend testing to -O1
1 parent 5a3ea38 commit a3ad48c

16 files changed

Lines changed: 82 additions & 38 deletions

File tree

.github/workflows/Test.yml

Lines changed: 37 additions & 38 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:
@@ -56,22 +57,15 @@ jobs:
5657
arch: x64
5758
- uses: julia-actions/cache@v3
5859
- 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;'
60+
run: julia --color=yes -e ' using Pkg;
61+
Pkg.activate("./DifferentiationInterface/test"); if VERSION < v"1.11";
62+
Pkg.rm("DifferentiationInterfaceTest"); Pkg.resolve(); else;
63+
Pkg.develop(; path="./DifferentiationInterfaceTest"); end;
64+
Pkg.activate("./DifferentiationInterface"); test_kwargs = (;
65+
allow_reresolve=false, coverage=true); if ENV["JULIA_DI_PR_DRAFT"] ==
66+
"true"; Pkg.test("DifferentiationInterface"; julia_args=["-O1"],
67+
test_kwargs...); else; Pkg.test("DifferentiationInterface";
68+
test_kwargs...); end;'
7569
- uses: julia-actions/julia-processcoverage@v1
7670
with:
7771
directories: ./DifferentiationInterface/src,./DifferentiationInterface/ext,./DifferentiationInterface/test
@@ -87,7 +81,8 @@ jobs:
8781
runs-on: ubuntu-latest
8882
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
8983
timeout-minutes: 120
90-
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
84+
permissions:
85+
# needed to allow julia-actions/cache to proactively delete old caches that it has created
9186
actions: write
9287
contents: read
9388
strategy:
@@ -116,13 +111,9 @@ jobs:
116111
- Zygote
117112
skip_lts:
118113
- ${{ github.event.pull_request.draft }}
119-
skip_pre:
120-
- ${{ github.event.pull_request.draft }}
121114
exclude:
122115
- skip_lts: true
123116
version: '1.10'
124-
- skip_pre: true
125-
version: '1.12'
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"];
134+
Pkg.activate("./DifferentiationInterface/test/Back/$group");
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"];
143142
Pkg.activate("./DifferentiationInterface/test/Back/$group");
144-
Pkg.develop([PackageSpec(path="./DifferentiationInterface"), PackageSpec(path="./DifferentiationInterfaceTest")]);
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:
@@ -193,15 +194,13 @@ jobs:
193194
arch: x64
194195
- uses: julia-actions/cache@v3
195196
- 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");
197+
run: julia --project=./DifferentiationInterfaceTest --color=yes -e ' using Pkg;
198+
Pkg.Registry.update(); Pkg.develop(path="./DifferentiationInterface");
200199
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;'
200+
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false,
201+
coverage=true, julia_args=["-O1"]); else;
202+
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false,
203+
coverage=true); end;'
205204
- uses: julia-actions/julia-processcoverage@v1
206205
with:
207206
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)