Skip to content

Commit 4319ca0

Browse files
authored
test: speed up CI with reduced compilation (-01) (#718)
* test: faster compilation with -O1 option * Add timing * Time O3 * Time in the correct place * O2 * O1 * O0 * Back to O1 * No benchmark test on 1.10 * Benchmark on 1.11 and higher * Run -O1 only for draft PRs * debug * Remove printing * fail fast
1 parent 4e694bb commit 4319ca0

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/Test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
group: Back/ChainRules
6161
env:
6262
JULIA_DI_TEST_GROUP: ${{ matrix.group }}
63+
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
6364
steps:
6465
- uses: actions/checkout@v4
6566
- uses: julia-actions/setup-julia@v2
@@ -72,7 +73,11 @@ jobs:
7273
run: julia --project=./DifferentiationInterface --color=yes -e '
7374
using Pkg;
7475
Pkg.Registry.update();
75-
Pkg.test("DifferentiationInterface"; coverage=true);'
76+
if ENV["JULIA_DI_PR_DRAFT"] == "true";
77+
Pkg.test("DifferentiationInterface"; coverage=true, julia_args=["-O1"]);
78+
else;
79+
Pkg.test("DifferentiationInterface"; coverage=true);
80+
end;'
7681
- uses: julia-actions/julia-processcoverage@v1
7782
with:
7883
directories: ./DifferentiationInterface/src,./DifferentiationInterface/ext,./DifferentiationInterface/test
@@ -109,6 +114,7 @@ jobs:
109114
version: "1.10"
110115
env:
111116
JULIA_DIT_TEST_GROUP: ${{ matrix.group }}
117+
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
112118
steps:
113119
- uses: actions/checkout@v4
114120
- uses: julia-actions/setup-julia@v2
@@ -121,7 +127,11 @@ jobs:
121127
using Pkg;
122128
Pkg.Registry.update();
123129
Pkg.develop(path="./DifferentiationInterface");
124-
Pkg.test("DifferentiationInterfaceTest"; coverage=true);'
130+
if ENV["JULIA_DI_PR_DRAFT"] == "true";
131+
Pkg.test("DifferentiationInterfaceTest"; coverage=true, julia_args=["-O1"]);
132+
else;
133+
Pkg.test("DifferentiationInterfaceTest"; coverage=true);
134+
end;'
125135
- uses: julia-actions/julia-processcoverage@v1
126136
with:
127137
directories: ./DifferentiationInterfaceTest/src,./DifferentiationInterfaceTest/ext,./DifferentiationInterfaceTest/test

DifferentiationInterface/test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include("testutils.jl")
1313

1414
## Main tests
1515

16-
@testset verbose = true "DifferentiationInterface.jl" begin
16+
@time @testset verbose = true "DifferentiationInterface.jl" begin
1717
if haskey(ENV, "JULIA_DI_TEST_GROUP")
1818
category, folder = split(ENV["JULIA_DI_TEST_GROUP"], '/')
1919
@testset verbose = true "$category" begin

DifferentiationInterfaceTest/test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ GROUP = get(ENV, "JULIA_DIT_TEST_GROUP", "All")
99

1010
## Main tests
1111

12-
@testset verbose = true "DifferentiationInterfaceTest.jl" begin
12+
@time @testset verbose = true "DifferentiationInterfaceTest.jl" begin
1313
if GROUP == "Formalities" || GROUP == "All"
1414
@testset verbose = true "Formalities" begin
1515
include("formalities.jl")

0 commit comments

Comments
 (0)