Skip to content

Commit

Permalink
feat: test on windows and macos-latest (#112)
Browse files Browse the repository at this point in the history
* feat: test on windows and macos-latest

* m1 homebrew different dir

* update diffsl

* add diffsl-llvm18

* fix yml
  • Loading branch information
martinjrobins authored Dec 11, 2024
1 parent 2609b6f commit b4d002c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
38 changes: 22 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ jobs:
- stable
os:
- ubuntu-latest
- macos-13
#- windows-latest
- macos-latest
- windows-latest
include:
- toolchain: beta
os: ubuntu-latest
- toolchain: nightly
os: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -50,31 +52,35 @@ jobs:
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)
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
if : matrix.os == 'ubuntu-latest'
if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-13' || matrix.os == 'macos-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
version: "16.0"
- name: Set features variable and install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
echo "ADDITIONAL_FEATURES_FLAGS=--features sundials --features suitesparse" >> $GITHUB_ENV
echo "ADDITIONAL_FEATURES_FLAGS=--features diffsl-llvm16 --features sundials --features suitesparse" >> $GITHUB_ENV
sudo apt-get update
sudo apt-get install -y libsuitesparse-dev libsundials-dev
- name: Set features variable and install dependencies (macOS)
if: matrix.os == 'macos-13' || matrix.os == 'macos-latest'
run: |
echo "ADDITIONAL_FEATURES_FLAGS=--features diffsl-llvm16" >> $GITHUB_ENV
- name: Set features variable and install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
echo "ADDITIONAL_FEATURES_FLAGS=--features diffsl" >> $GITHUB_ENV
- 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 || '' }}
run: cargo test --verbose ${{ env.ADDITIONAL_FEATURES_FLAGS || '' }}
- name: Clippy - all features
run: cargo clippy --verbose --features diffsl-llvm14 ${{ env.ADDITIONAL_FEATURES_FLAGS || ''}}
if : matrix.os == 'ubuntu-latest' && matrix.toolchain == 'nightly'
run: cargo clippy --verbose ${{ env.ADDITIONAL_FEATURES_FLAGS || ''}}
- name: Docs - all features
run: cargo rustdoc --features diffsl-llvm14 ${{ env.ADDITIONAL_FEATURES_FLAGS || ''}}
if : matrix.os == 'ubuntu-latest' && matrix.toolchain == 'nightly'
run: cargo rustdoc ${{ env.ADDITIONAL_FEATURES_FLAGS || ''}}
book:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@ sundials = ["suitesparse_sys", "bindgen", "cc"]
suitesparse = ["suitesparse_sys"]
diffsl = ["dep:diffsl"]
diffsl-llvm = []
diffsl-llvm13 = ["diffsl/llvm13-0", "diffsl", "diffsl-llvm"]
diffsl-llvm14 = ["diffsl/llvm14-0", "diffsl", "diffsl-llvm"]
diffsl-llvm15 = ["diffsl/llvm15-0", "diffsl", "diffsl-llvm"]
diffsl-llvm16 = ["diffsl/llvm16-0", "diffsl", "diffsl-llvm"]
diffsl-llvm17 = ["diffsl/llvm17-0", "diffsl", "diffsl-llvm"]
diffsl-llvm18 = ["diffsl/llvm18-0", "diffsl", "diffsl-llvm"]

[dependencies]
nalgebra = "0.33.2"
nalgebra-sparse = { version = "0.10", features = ["io"] }
num-traits = "0.2.17"
serde = { version = "1.0.215", features = ["derive"] }
diffsl = { package = "diffsl", version = "0.2.5", optional = true }
serde = { version = "1.0.216", features = ["derive"] }
diffsl = { package = "diffsl", version = "0.2.6", optional = true }
petgraph = "0.6.4"
faer = "0.19.4"
suitesparse_sys = { version = "0.1.3", optional = true }
Expand Down

0 comments on commit b4d002c

Please sign in to comment.