name: CI on: push: branches: [main, develop] paths: - 'examples/scipix/**' - '.github/workflows/ci.yml' pull_request: paths: - 'examples/scipix/**' - '.github/workflows/ci.yml' env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 jobs: check: name: Check runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy - name: Cache cargo registry uses: actions/cache@v4 with: path: ~/.cargo/registry key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo index uses: actions/cache@v4 with: path: ~/.cargo/git key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo build uses: actions/cache@v4 with: path: target key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - name: Check formatting run: cargo fmt --check --manifest-path examples/scipix/Cargo.toml - name: Run clippy run: cargo clippy --manifest-path examples/scipix/Cargo.toml --all-features --all-targets -- -D warnings - name: Check compilation run: cargo check --manifest-path examples/scipix/Cargo.toml --all-features test: name: Test Suite runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] rust: [stable, nightly] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - name: Cache dependencies uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run tests run: cargo test --manifest-path examples/scipix/Cargo.toml --all-features --verbose - name: Run doc tests run: cargo test --manifest-path examples/scipix/Cargo.toml --doc coverage: name: Code Coverage runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Install tarpaulin run: cargo install cargo-tarpaulin - name: Generate coverage run: cargo tarpaulin --manifest-path examples/scipix/Cargo.toml --all-features --out xml --output-dir ./coverage - name: Upload to codecov uses: codecov/codecov-action@v4 with: files: ./coverage/cobertura.xml flags: scipix fail_ci_if_error: false - name: Check coverage threshold run: | cargo tarpaulin --manifest-path examples/scipix/Cargo.toml --all-features --fail-under 80 bench: name: Benchmarks runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Cache dependencies uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }} - name: Build benchmarks run: cargo bench --manifest-path examples/scipix/Cargo.toml --no-run - name: Run benchmarks run: cargo bench --manifest-path examples/scipix/Cargo.toml -- --save-baseline pr wasm: name: WebAssembly Build runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable with: targets: wasm32-unknown-unknown - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - name: Build WASM run: | cd examples/scipix wasm-pack build --target web --features wasm - name: Test WASM run: | cd examples/scipix wasm-pack test --headless --firefox --chrome security: name: Security Audit runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Install cargo-audit run: cargo install cargo-audit - name: Run security audit run: cargo audit --manifest-path examples/scipix/Cargo.toml - name: Run cargo-deny uses: EmbarkStudios/cargo-deny-action@v1 with: manifest-path: examples/scipix/Cargo.toml