I98 adjoint #360
Workflow file for this run
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 | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_HOME: ${{ github.workspace }}/.cargo | |
RUSTFLAGS: -D warnings -A unused-imports | |
RUSTDOCFLAGS: -D warnings | |
RUST_BACKTRACE: full | |
jobs: | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update stable --no-self-update | |
- run: rustc -Vv | |
- run: cargo fmt --all -- --check | |
unit-tests: | |
name: Tests - ${{ matrix.os }} - ${{ matrix.toolchain }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
os: | |
- ubuntu-latest | |
- macos-13 | |
#- windows-latest | |
include: | |
- toolchain: beta | |
os: ubuntu-latest | |
- toolchain: nightly | |
os: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v3.3.2 | |
with: | |
path: | | |
${{ env.CARGO_HOME }} | |
target | |
key: diffsol-${{ runner.os }}-${{ matrix.toolchain}} | |
- name: Set up Rust | |
run: rustup default ${{ matrix.toolchain }} && rustup update ${{ matrix.toolchain }} --no-self-update && rustup component add clippy | |
- name: Rust version | |
run: rustc -Vv | |
- name: Install LLVM and Clang (Ubuntu) | |
uses: KyleMayes/install-llvm-action@v2 | |
if : matrix.os == 'ubuntu-latest' | |
with: | |
version: "14.0" | |
- name: Install LLVM and Clang (macOS) | |
if : matrix.os == 'macos-13' | |
run: | | |
brew install llvm@14 | |
echo "LLVM_SYS_140_PREFIX=/usr/local/opt/llvm@14" >> $GITHUB_ENV | |
echo "LLVM_DIR=/usr/local/opt/llvm@14" >> $GITHUB_ENV | |
- name: Set features variable and install dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
echo "ADDITIONAL_FEATURES_FLAGS=--features sundials --features suitesparse" >> $GITHUB_ENV | |
sudo apt-get update | |
sudo apt-get install -y libsuitesparse-dev libsundials-dev | |
- name: Run tests - default features | |
run: cargo test --verbose | |
- name: Run tests - all features | |
run: cargo test --verbose --features diffsl-llvm14 ${{ env.ADDITIONAL_FEATURES_FLAGS || '' }} | |
- name: Clippy - all features | |
run: cargo clippy --verbose --features diffsl-llvm14 ${{ env.ADDITIONAL_FEATURES_FLAGS || ''}} | |
- name: Docs - all features | |
run: cargo rustdoc --features diffsl-llvm14 ${{ env.ADDITIONAL_FEATURES_FLAGS || ''}} | |
book: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup mdBook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
mdbook-version: 'latest' | |
- run: mdbook build book | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./book/book |