-
Notifications
You must be signed in to change notification settings - Fork 47
225 lines (207 loc) · 6.26 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
name: CI
on:
push:
pull_request:
branches:
- master
schedule:
- cron: '0 0 15 * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
CLIPPY_DISABLE_DOCS_LINKS: 1
jobs:
rustfmt:
name: rustfmt
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with: {submodules: true}
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- name: Check formatting
run: cargo fmt -- --check
documentation:
name: documentation
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with: {submodules: true}
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Documentation
run: cargo doc --all-features --workspace
clippy:
name: clippy
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with: {submodules: true}
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- name: Run Clippy
run: cargo clippy --workspace --all-features -- -W clippy::doc_markdown -W clippy::needless_borrow -W clippy::checked_conversions -W clippy::unseparated_literal_suffix -W clippy::unreadable_literal -W clippy::if_not_else -W clippy::needless_continue -W clippy::match_same_arms -W clippy::match_wildcard_for_single_variants -W clippy::explicit_into_iter_loop -W clippy::needless_borrow
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- build: msrv
os: ubuntu-20.04
rust: 1.77.0
- build: stable
os: ubuntu-20.04
rust: stable
- build: beta
os: ubuntu-20.04
rust: beta
- build: nightly
os: ubuntu-20.04
rust: nightly
- build: macos
os: macos-latest
rust: stable
- build: win-msvc
os: windows-2019
rust: stable
- build: win-gnu
os: windows-2019
rust: stable
steps:
- name: Checkout repository
uses: actions/checkout@v4
with: {submodules: true}
- name: Install suitesparse
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get install libsuitesparse-dev
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Build (exclude suitesparse)
run: cargo build --verbose --workspace --exclude suitesparse_ldl_sys --exclude sprs_suitesparse_ldl --exclude sprs_suitesparse_camd --exclude suitesparse_camd_sys --exclude suitesparse_umfpack_sys --exclude sprs_suitesparse_umfpack
if: matrix.os != 'ubuntu-20.04'
- name: Build (all)
run: cargo build --verbose --workspace
if: matrix.os == 'ubuntu-20.04'
- name: Test (exclude suitesparse)
run: cargo test --verbose --workspace --exclude suitesparse_ldl_sys --exclude sprs_suitesparse_ldl --exclude sprs_suitesparse_camd --exclude suitesparse_camd_sys --exclude suitesparse_umfpack_sys --exclude sprs_suitesparse_umfpack
if: matrix.os != 'ubuntu-20.04'
- name: Test (all)
run: cargo test --verbose --workspace
if: matrix.os == 'ubuntu-20.04'
- name: Test (suitesparse integration)
run: cargo test -p sprs-ldl --features "sprs-ldl/sprs_suitesparse_ldl sprs-ldl/sprs_suitesparse_camd"
if: matrix.os == 'ubuntu-20.04' && matrix.build == 'nightly'
benches:
name: benchmarks
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with: {submodules: true}
- name: Install dependencies
run: |
sudo apt-get install libeigen3-dev libsuitesparse-dev
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- name: Run benchmarks
run: |
cargo bench --workspace
optional_none:
name: Optional features (none selected)
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with: {submodules: true}
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- name: Run test
run: |
cargo test --no-default-features -p sprs
optional_approx:
name: Optional features (approx selected)
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with: {submodules: true}
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
override: true
profile: minimal
- name: Run test
run: |
cargo test --features approx -p sprs
static_suitesparse:
name: static SuiteSparse
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- build: stable
os: ubuntu-20.04
rust: stable
- build: macos
os: macos-latest
rust: stable
- build: win-msvc
os: windows-2019
rust: stable
- build: win-gnu
os: windows-2019
rust: stable
steps:
- name: Checkout repository
uses: actions/checkout@v4
with: {submodules: true}
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- name: Run tests (camd)
run: |
cd suitesparse_bindings/sprs_suitesparse_camd
cargo test -p suitesparse_camd_sys --features static -p sprs
- name: Run tests (ldl)
run: |
cd suitesparse_bindings/sprs_suitesparse_ldl
cargo test -p suitesparse_ldl_sys --features static -p sprs
miri:
name: Miri
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with: {submodules: false}
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: miri
- name: Run test
run: |
cargo miri test -p sprs --no-default-features --features alga,approx,serde