-
-
Notifications
You must be signed in to change notification settings - Fork 84
209 lines (192 loc) · 8.58 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: argmin CI
on:
pull_request:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
tests-argmin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Test (default features)
run: cargo test -p argmin
- name: Test (all features)
run: cargo test -p argmin --all-features
tests-argmin-serde1-feature:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Test (no default features)
run: cargo test -p argmin --no-default-features
- name: Test with serde1 feature
run: cargo test -p argmin --no-default-features --features "serde1"
tests-argmin-observer-slog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Test without default features
run: cargo test -p argmin-observer-slog --no-default-features
- name: Test with serde1 feature
run: cargo test -p argmin-observer-slog --no-default-features --features "serde1"
tests-argmin-observer-paramwriter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Test
run: cargo test -p argmin-observer-paramwriter
tests-argmin-checkpointing-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Test
run: cargo test -p argmin-checkpointing-file
tests-argmin-observer-spectator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Test (spectator observer)
run: cargo test -p argmin-observer-spectator
- name: Test (spectator)
run: cargo test -p spectator
tests-argmin-testfunctions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Test (testfunctions)
run: cargo test -p argmin_testfunctions
tests-argmin-math:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
# NOTE: These are in series on purpose, in the hope that not everything
# has to be recompiled every time.
# Default features
- name: argmin-math (primitives)
run: cargo test -p argmin-math --no-default-features --features "primitives"
- name: argmin-math (vec)
run: cargo test -p argmin-math --no-default-features --features "vec"
# ndarray without linalg
- name: argmin-math (ndarray_latest-nolinalg)
run: cargo test -p argmin-math --no-default-features --features "ndarray_latest-nolinalg"
- name: argmin-math (ndarray_v0_16-nolinalg)
run: cargo test -p argmin-math --no-default-features --features "ndarray_v0_16-nolinalg"
- name: argmin-math (ndarray_v0_15-nolinalg)
run: cargo test -p argmin-math --no-default-features --features "ndarray_v0_15-nolinalg"
- name: argmin-math (ndarray_v0_14-nolinalg)
run: cargo test -p argmin-math --no-default-features --features "ndarray_v0_14-nolinalg"
- name: argmin-math (ndarray_v0_13-nolinalg)
run: cargo test -p argmin-math --no-default-features --features "ndarray_v0_13-nolinalg"
# ndarray with linalg
- name: argmin-math (ndarray_latest)
run: cargo test --manifest-path ./crates/argmin-math/ndarray-linalg-tests/ndarray_latest/Cargo.toml
- name: argmin-math (ndarray_v0_16)
run: cargo test --manifest-path ./crates/argmin-math/ndarray-linalg-tests/ndarray_0_16/Cargo.toml
- name: argmin-math (ndarray_v0_15)
run: cargo test --manifest-path ./crates/argmin-math/ndarray-linalg-tests/ndarray_0_15/Cargo.toml
- name: argmin-math (ndarray_v0_14)
run: cargo test --manifest-path ./crates/argmin-math/ndarray-linalg-tests/ndarray_0_14/Cargo.toml
- name: argmin-math (ndarray_v0_13)
run: cargo test --manifest-path ./crates/argmin-math/ndarray-linalg-tests/ndarray_0_13/Cargo.toml
# nalgebra
- name: argmin-math (nalgebra_latest)
run: cargo test -p argmin-math --no-default-features --features "nalgebra_latest"
- name: argmin-math (nalgebra_v0_32)
run: cargo test -p argmin-math --no-default-features --features "nalgebra_v0_32"
- name: argmin-math (nalgebra_v0_31)
run: cargo test -p argmin-math --no-default-features --features "nalgebra_v0_31"
- name: argmin-math (nalgebra_v0_30)
run: cargo test -p argmin-math --no-default-features --features "nalgebra_v0_30"
- name: argmin-math (nalgebra_v0_29)
run: cargo test -p argmin-math --no-default-features --features "nalgebra_v0_29"
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@beta
with:
components: clippy
- name: Clippy (argmin-math)
run: cargo clippy -p argmin-math --all-targets --features "primitives,vec,nalgebra_latest,ndarray_latest" -- -D warnings
- name: Clippy (argmin) with all features
run: cargo clippy -p argmin --all-targets --features "_full_dev" -- -D warnings
- name: Clippy (argmin-observer-slog)
run: cargo clippy -p argmin-observer-slog --all-targets --features "serde1" -- -D warnings
- name: Clippy (argmin-observer-paramwriter)
run: cargo clippy -p argmin-observer-paramwriter --all-targets -- -D warnings
- name: Clippy (argmin-observer-spectator)
run: cargo clippy -p argmin-observer-spectator --all-targets -- -D warnings
- name: Clippy (argmin-checkpointing-file)
run: cargo clippy -p argmin-checkpointing-file --all-targets -- -D warnings
- name: Clippy (spectator)
run: cargo clippy -p spectator --all-targets -- -D warnings
- name: Clippy (examples)
run: cargo clippy -p 'example-*' --all-targets --all-features -- -D warnings
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@beta
with:
components: rustfmt
- run: cargo fmt --all -- --check
docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: argmin docs
run: cargo rustdoc -p argmin --all-features -- -D warnings
- name: argmin-math docs
run: cargo rustdoc -p argmin-math --features "latest_all" -- -D warnings
wasm-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown,wasm32-unknown-emscripten,wasm32-wasi
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build target wasm32-unknown-unknown
run: cargo build --workspace --exclude argmin-observer-spectator --exclude spectator --exclude argmin-observer-paramwriter --exclude "example-*" --exclude argmin-testfunctions-py --target wasm32-unknown-unknown --features wasm-bindgen
- name: Build target wasm32-wasi with feature wasm-bindgen
run: cargo build --workspace --exclude argmin-observer-spectator --exclude spectator --exclude argmin-observer-paramwriter --exclude "example-*" --exclude argmin-testfunctions-py --target wasm32-wasi --features wasm-bindgen
- name: Build target wasm32-unknown-emscripten
run: cargo build --workspace --exclude argmin-observer-spectator --exclude spectator --exclude argmin-observer-paramwriter --exclude "example-*" --exclude argmin-testfunctions-py --target wasm32-unknown-emscripten --no-default-features --features wasm-bindgen
cargo-deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}