|
| 1 | +# SPDX-License-Identifier: MPL-2.0 |
| 2 | +name: Rust |
| 3 | +# Build + test + clippy gate for the three standalone Rust crates. |
| 4 | +# Added after a non-compiling crate (robot-repo-automaton) reached `main` |
| 5 | +# unnoticed: the only prior Rust CI was CodeQL in build-mode `none` |
| 6 | +# (buildless), so nothing actually compiled or tested these crates. |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: [main] |
| 10 | + pull_request: |
| 11 | + branches: ['**'] |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | +env: |
| 15 | + CARGO_TERM_COLOR: always |
| 16 | + # reqwest=rustls-tls, git2=vendored-openssl, gix=rust-tls. OPENSSL_NO_VENDOR |
| 17 | + # makes openssl-sys link the runner's preinstalled system OpenSSL instead of |
| 18 | + # recompiling the vendored copy (matches the documented local build). |
| 19 | + OPENSSL_NO_VENDOR: '1' |
| 20 | +jobs: |
| 21 | + rust: |
| 22 | + name: build · test · clippy |
| 23 | + runs-on: ubuntu-latest |
| 24 | + timeout-minutes: 30 |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + crate: [robot-repo-automaton, shared-context, dashboard] |
| 29 | + defaults: |
| 30 | + run: |
| 31 | + working-directory: ${{ matrix.crate }} |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 34 | + - name: Ensure clippy + rustfmt components |
| 35 | + run: rustup component add clippy rustfmt |
| 36 | + - name: Build (all targets) |
| 37 | + run: cargo build --all-targets --verbose |
| 38 | + - name: Test |
| 39 | + run: cargo test --verbose |
| 40 | + - name: Clippy (deny warnings) |
| 41 | + run: cargo clippy --all-targets -- -D warnings |
| 42 | + - name: Rustfmt check (informational) |
| 43 | + # Pre-existing formatting drift is not yet gated; surfaced here so it |
| 44 | + # stays visible without blocking. Flip to a hard gate after a dedicated |
| 45 | + # `cargo fmt` pass lands. |
| 46 | + run: cargo fmt --check |
| 47 | + continue-on-error: true |
0 commit comments