name: explorer-rust # Only changes to the Rust workspace, or to this workflow, run it. on: push: paths: - "explorer/crates/**" - "explorer/Cargo.toml" - "explorer/Cargo.lock" - "explorer/rust-toolchain" - "explorer/.cargo/**" - ".github/workflows/explorer-rust.yml" workflow_dispatch: env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true # Debug info is most of a target/ directory. Line tables keep file:line in # panics and backtraces, and make builds and caches much smaller. CARGO_PROFILE_DEV_DEBUG: line-tables-only defaults: run: working-directory: explorer jobs: test: name: Build & Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@1.97.1 - uses: Swatinem/rust-cache@v2 with: workspaces: "explorer -> target" # Only master saves, so patches share its caches instead of each # storing their own, which pushes the repo over GitHub's 10 GB limit. save-if: ${{ github.ref == 'refs/heads/master' }} - name: Build (all features) run: cargo build --workspace --all-features env: RUSTFLAGS: -D warnings - name: Test (all features) run: cargo test --workspace --all-features - name: Test httpd without search run: cargo test -p radicle-httpd lint: name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@1.97.1 with: components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 with: workspaces: "explorer -> target" # Only master saves, so patches share its caches instead of each # storing their own, which pushes the repo over GitHub's 10 GB limit. save-if: ${{ github.ref == 'refs/heads/master' }} - name: Run clippy run: cargo clippy --workspace --all-features --tests env: RUSTFLAGS: -D warnings # Nothing else compiles the artifacts-off path, so it would rot. - name: Run clippy on httpd without default features run: cargo clippy -p radicle-httpd --no-default-features --tests env: RUSTFLAGS: -D warnings - name: Check formatting run: cargo fmt --all -- --check