chore: Update to branch with latest svgbob version. (#333) #709
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
name: Build (stable) | |
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 | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: [email protected] | |
- name: Check (pywr-core) | |
run: cargo hack check --feature-powerset --no-dev-deps -p pywr-core --exclude-features ipm-simd,ipm-ocl | |
- name: Check (pywr-schema) | |
run: cargo hack check --feature-powerset --no-dev-deps -p pywr-schema --exclude-features ipm-simd,ipm-ocl | |
- 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_nightly: | |
name: Build (nightly) w/ SIMD and OpenCL | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: dtolnay/rust-toolchain@nightly | |
- name: Install Intel OpenCL | |
run: sudo apt-get install -y intel-opencl-icd ocl-icd-opencl-dev | |
- name: Build | |
run: cargo +nightly build --verbose --features highs,cbc,ipm-simd,ipm-ocl | |
- name: Run tests (SIMD only) | |
# Run tests with SIMD only to avoid OpenCL runtime requirement on Github actions. | |
run: cargo +nightly test --features highs,cbc,ipm-simd |