Snapshot local work before sync #238
This file contains hidden or 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
| # SPDX-License-Identifier: PMPL-1.0-or-later | |
| name: Rust CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| # ============================================================================ | |
| # Build and Test | |
| # ============================================================================ | |
| test: | |
| name: Test Suite | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b # stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db # v2 | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Clippy lints | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Run unit tests | |
| run: cargo test --lib --all-features | |
| - name: Run integration tests | |
| run: cargo test --test integration_tests --all-features | |
| - name: Build release | |
| run: cargo build --release | |
| # ============================================================================ | |
| # Security Audit | |
| # ============================================================================ | |
| security: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b # stable | |
| with: | |
| toolchain: stable | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit --locked | |
| - name: Run security audit | |
| run: cargo audit | |
| # ============================================================================ | |
| # Code Coverage | |
| # ============================================================================ | |
| coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b # stable | |
| with: | |
| toolchain: stable | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db # v2 | |
| - name: Install tarpaulin | |
| run: cargo install cargo-tarpaulin --locked | |
| - name: Generate coverage | |
| run: cargo tarpaulin --out xml --skip-clean | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5 | |
| with: | |
| files: cobertura.xml | |
| fail_ci_if_error: false | |
| # ============================================================================ | |
| # Documentation Build | |
| # ============================================================================ | |
| docs: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b # stable | |
| with: | |
| toolchain: stable | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db # v2 | |
| - name: Build documentation | |
| run: cargo doc --no-deps --all-features | |
| env: | |
| RUSTDOCFLAGS: -D warnings | |
| # ============================================================================ | |
| # Julia Integration (Optional) | |
| # ============================================================================ | |
| julia-integration: | |
| name: Julia Integration | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b # stable | |
| with: | |
| toolchain: stable | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db # v2 | |
| - name: Setup Julia | |
| uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71 # v2 | |
| with: | |
| version: '1.10' | |
| - name: Cache Julia packages | |
| uses: julia-actions/cache@580d2b69d895343992af2cbad49c32a0149c2cde # v2 | |
| - name: Install Julia dependencies | |
| run: | | |
| cd src/julia | |
| julia --project=. -e 'using Pkg; Pkg.instantiate()' | |
| - name: Start Julia test server | |
| run: | | |
| cd src/julia | |
| julia --project=. test_server.jl 8081 & | |
| sleep 10 | |
| curl -s http://localhost:8081/health || exit 1 | |
| - name: Run integration tests | |
| run: cargo test --test test_neural_integration -- --include-ignored | |
| # ============================================================================ | |
| # MSRV Check | |
| # ============================================================================ | |
| msrv: | |
| name: Minimum Supported Rust Version | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| - name: Setup Rust toolchain (MSRV) | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b # stable | |
| with: | |
| toolchain: '1.75' | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db # v2 | |
| - name: Check MSRV | |
| run: cargo check --all-features |