name: CI on: push: branches: [main] pull_request: branches: [main] env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 jobs: # ─────────────────────────────────────────────────────────────── # Format + lint. Fast feedback gate before the expensive jobs. # ─────────────────────────────────────────────────────────────── lint: name: fmt + clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: "1.95" components: rustfmt, clippy - name: Cache cargo uses: Swatinem/rust-cache@v2 - name: cargo fmt --check run: cargo fmt --all -- --check - name: cargo clippy (default features) run: cargo clippy --workspace --all-targets -- -D warnings - name: cargo clippy (op-rails-crypto evm) run: cargo clippy -p op-rails-crypto --features evm --all-targets -- -D warnings - name: cargo clippy (op-webhook reqwest-transport) run: cargo clippy -p op-webhook --features reqwest-transport --all-targets -- -D warnings # ─────────────────────────────────────────────────────────────── # Build + unit tests across the workspace, default features. # ─────────────────────────────────────────────────────────────── test: name: cargo test --workspace runs-on: ubuntu-latest needs: lint steps: - uses: actions/checkout@v4 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: "1.95" - name: Cache cargo uses: Swatinem/rust-cache@v2 - name: cargo build (workspace, all targets) run: cargo build --workspace --all-targets - name: cargo test (workspace) run: cargo test --workspace --no-fail-fast # ─────────────────────────────────────────────────────────────── # Feature-gated test paths that the default workspace run misses. # Kept as separate jobs so a feature regression is obvious. # ─────────────────────────────────────────────────────────────── test-features: name: cargo test (feature-gated) runs-on: ubuntu-latest needs: lint steps: - uses: actions/checkout@v4 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: "1.95" - name: Cache cargo uses: Swatinem/rust-cache@v2 - name: test op-webhook --features reqwest-transport run: cargo test -p op-webhook --features reqwest-transport --no-fail-fast - name: test op-rails-crypto --features evm run: cargo test -p op-rails-crypto --features evm --no-fail-fast # ─────────────────────────────────────────────────────────────── # Doc build. Broken intra-doc links are common; catch them here. # ─────────────────────────────────────────────────────────────── docs: name: cargo doc runs-on: ubuntu-latest needs: lint steps: - uses: actions/checkout@v4 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: "1.95" - name: Cache cargo uses: Swatinem/rust-cache@v2 - name: cargo doc --no-deps env: RUSTDOCFLAGS: "-D warnings" run: cargo doc --workspace --no-deps --document-private-items