-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (52 loc) · 1.82 KB
/
linux.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
name: Rust (Linux)
on:
push:
branches: [ main ]
pull_request:
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
# Make sure CI fails on all warnings, including Clippy lints
RUSTFLAGS: "-Dwarnings"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: swatinem/rust-cache@v2
- name: Run Clippy
run: cargo clippy --all-targets --features highs,cbc --all --exclude ipm-simd
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir bin
curl -sSL $url | tar -xz --directory=bin
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Build
run: cargo build --verbose --features highs,cbc --workspace --exclude ipm-simd --exclude pywr-python
- name: Run tests
run: cargo test --features highs,cbc --verbose --lib --bins -- --test-threads=1
- name: Run mdbook test & build
run: |
output=$(mdbook test ./pywr-book 2>&1)
if echo "$output" | grep -q "\[ERROR\]" ; then
exit 1
fi
output=$(mdbook build ./pywr-book 2>&1)
if echo "$output" | grep -q "\[ERROR\]" ; then
exit 1
fi
build_schema_only:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose --no-default-features --package [email protected]
- name: Run tests
run: cargo test --verbose --no-default-features --package [email protected]