Skip to content

Commit df06103

Browse files
committed
test: first order tests
1 parent 52a2387 commit df06103

File tree

6 files changed

+107
-3
lines changed

6 files changed

+107
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI (NonlinearSolveFirstOrder)
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths:
8+
- "lib/NonlinearSolveFirstOrder/**"
9+
- ".github/workflows/CI_NonlinearSolveFirstOrder.yml"
10+
- "lib/NonlinearSolveBase/**"
11+
- "lib/SciMLJacobianOperators/**"
12+
push:
13+
branches:
14+
- master
15+
16+
concurrency:
17+
# Skip intermediate builds: always.
18+
# Cancel intermediate builds: only if it is a pull request build.
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
21+
22+
jobs:
23+
test:
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
version:
29+
- "lts"
30+
- "1"
31+
os:
32+
- ubuntu-latest
33+
- macos-latest
34+
- windows-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: julia-actions/setup-julia@v2
38+
with:
39+
version: ${{ matrix.version }}
40+
- uses: actions/cache@v4
41+
env:
42+
cache-name: cache-artifacts
43+
with:
44+
path: ~/.julia/artifacts
45+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
46+
restore-keys: |
47+
${{ runner.os }}-test-${{ env.cache-name }}-
48+
${{ runner.os }}-test-
49+
${{ runner.os }}-
50+
- name: "Install Dependencies and Run Tests"
51+
run: |
52+
import Pkg
53+
Pkg.Registry.update()
54+
# Install packages present in subdirectories
55+
dev_pks = Pkg.PackageSpec[]
56+
for path in ("lib/SciMLJacobianOperators", "lib/NonlinearSolveBase")
57+
push!(dev_pks, Pkg.PackageSpec(; path))
58+
end
59+
Pkg.develop(dev_pks)
60+
Pkg.instantiate()
61+
Pkg.test(; coverage="user")
62+
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=lib/NonlinearSolveFirstOrder {0}
63+
- uses: julia-actions/julia-processcoverage@v1
64+
with:
65+
directories: lib/NonlinearSolveFirstOrder/src,lib/NonlinearSolveBase/src,lib/NonlinearSolveBase/ext,lib/SciMLJacobianOperators/src
66+
- uses: codecov/codecov-action@v4
67+
with:
68+
file: lcov.info
69+
token: ${{ secrets.CODECOV_TOKEN }}
70+
verbose: true
71+
fail_ci_if_error: true

lib/NonlinearSolveFirstOrder/Project.toml

+13-2
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,19 @@ StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
2727
ADTypes = "1.9.0"
2828
Aqua = "0.8"
2929
ArrayInterface = "7.16.0"
30+
BenchmarkTools = "1.5.0"
3031
CommonSolve = "0.2.4"
3132
ConcreteStructs = "0.2.3"
3233
DiffEqBase = "6.155.3"
34+
Enzyme = "0.13.12"
3335
ExplicitImports = "1.5"
3436
FiniteDiff = "2.26.0"
3537
ForwardDiff = "0.10.36"
3638
Hwloc = "3"
3739
InteractiveUtils = "<0.0.1, 1"
3840
LineSearch = "0.1.4"
39-
LinearAlgebra = "1.11.0"
41+
LineSearches = "7.3.0"
42+
LinearAlgebra = "1.10"
4043
LinearSolve = "2.36.1"
4144
MaybeInplace = "0.1.4"
4245
NonlinearProblemLibrary = "0.1.2"
@@ -46,22 +49,30 @@ PrecompileTools = "1.2"
4649
ReTestItems = "1.24"
4750
Reexport = "1"
4851
SciMLBase = "2.54"
52+
SciMLJacobianOperators = "0.1.0"
4953
Setfield = "1.1.1"
5054
StableRNGs = "1"
55+
StaticArrays = "1.9.8"
5156
StaticArraysCore = "1.4.3"
5257
Test = "1.10"
58+
Zygote = "0.6.72"
5359
julia = "1.10"
5460

5561
[extras]
5662
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
63+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
64+
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
5765
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
5866
Hwloc = "0e44f5e4-bd66-52a0-8798-143a42290a1d"
5967
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
68+
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
6069
NonlinearProblemLibrary = "b7050fa9-e91f-4b37-bcee-a89a063da141"
6170
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
6271
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
6372
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
73+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
6474
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
75+
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
6576

6677
[targets]
67-
test = ["Aqua", "ExplicitImports", "Hwloc", "InteractiveUtils", "NonlinearProblemLibrary", "Pkg", "ReTestItems", "StableRNGs", "Test"]
78+
test = ["Aqua", "BenchmarkTools", "Enzyme", "ExplicitImports", "Hwloc", "InteractiveUtils", "LineSearches", "NonlinearProblemLibrary", "Pkg", "ReTestItems", "StableRNGs", "StaticArrays", "Test", "Zygote"]

lib/NonlinearSolveFirstOrder/test/least_squares_tests.jl

Whitespace-only changes.

lib/NonlinearSolveFirstOrder/test/rootfind_tests.jl

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1+
using ReTestItems, NonlinearSolveFirstOrder, Hwloc, InteractiveUtils, Pkg
12

3+
@info sprint(InteractiveUtils.versioninfo)
4+
5+
const GROUP = lowercase(get(ENV, "GROUP", "All"))
6+
7+
const RETESTITEMS_NWORKERS = parse(
8+
Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 4)))
9+
)
10+
const RETESTITEMS_NWORKER_THREADS = parse(Int,
11+
get(
12+
ENV, "RETESTITEMS_NWORKER_THREADS",
13+
string(max(Hwloc.num_virtual_cores() ÷ RETESTITEMS_NWORKERS, 1))
14+
)
15+
)
16+
17+
@info "Running tests for group: $(GROUP) with $(RETESTITEMS_NWORKERS) workers"
18+
19+
ReTestItems.runtests(
20+
NonlinearSolveFirstOrder; tags = (GROUP == "all" ? nothing : [Symbol(GROUP)]),
21+
nworkers = RETESTITEMS_NWORKERS, nworker_threads = RETESTITEMS_NWORKER_THREADS,
22+
testitem_timeout = 3600
23+
)

lib/NonlinearSolveQuasiNewton/test/core_tests.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ end
177177
cache = init(
178178
NonlinearProblem{false}(quadratic_f, u0, 2.0), solver, abstol = 1e-9
179179
)
180-
@test (@ballocated solve!($cache)) 320
180+
@test (@ballocated solve!($cache)) 400
181181
end
182182

183183
@testset "[IIP] u0: $(typeof(u0))" for u0 in (ones(32),)

0 commit comments

Comments
 (0)