fix(ci): clippy --no-deps to skip submodule path-dep lints #24
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| env: | |
| # The repo's .cargo/config.toml pins `build.target = "wasm32-wasip2"` | |
| # because the legacy C build expects it. CI runs on Linux and needs | |
| # native binaries (host crate, cache tests). Override to the runner's | |
| # native triple. `act` runs in a Linux container, so x86_64 is right | |
| # for amd64 runs and aarch64 for arm64 (act-by-default on Apple | |
| # Silicon). Use explicit triple instead of empty string: empty | |
| # CARGO_BUILD_TARGET breaks `cargo install` ("error: target was empty"). | |
| CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu | |
| # Drop debug info from the dev + test profiles. Linking the host | |
| # binary against wasmtime + rusqlite + reqwest pulls in a lot of | |
| # symbols; debuginfo dominates the final size and slows the linker | |
| # enough to OOM smaller runners. | |
| CARGO_PROFILE_DEV_DEBUG: "0" | |
| CARGO_PROFILE_TEST_DEBUG: "0" | |
| jobs: | |
| host-checks: | |
| name: Host crate — fmt + clippy + tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| # GitHub's hosted runners ship rustup; bootstrap it if absent | |
| # (running under act with a minimal image). The pinned channel | |
| # from rust-toolchain.toml gets materialized by `rustup show`. | |
| - name: Install pinned Rust toolchain | |
| run: | | |
| if ! command -v rustup >/dev/null 2>&1; then | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ | |
| | sh -s -- -y --default-toolchain none --profile minimal | |
| echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| fi | |
| rustup show | |
| - name: cargo fmt --check | |
| working-directory: host | |
| # Lint only host's own code; --all would walk path-deps | |
| # into submodules (sqlite-loader-wit, sqlite-wasm/core) | |
| # whose fmt is enforced by their own CI. Drift across | |
| # submodule rustfmt versions is real and shouldn't gate | |
| # sqlink CI. | |
| run: cargo fmt --check | |
| - name: cargo clippy | |
| working-directory: host | |
| # --no-deps so clippy doesn't lint submodule path-deps | |
| # (sqlite-embed, sqlite-component-core, etc. live in the | |
| # sqlite-wasm submodule; their lint state isn't sqlink's | |
| # to enforce). All-features so the auth/SPI/compose paths | |
| # build. -D warnings turns lint warnings into failures. | |
| run: cargo clippy --all-targets --all-features --no-deps -- -D warnings | |
| - name: cargo test (host crate) | |
| working-directory: host | |
| # All tests run on the native target. The fiji_function smoke | |
| # test gracefully skips when the fiji_hello.wasm artifact is | |
| # absent — this job is native-only by design; wasm-side build | |
| # + extension-smoke are in .github/workflows/wasm-smoke.yml. | |
| run: cargo test --all-features | |
| cache-tests: | |
| name: CAS cache unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install pinned Rust toolchain | |
| run: | | |
| if ! command -v rustup >/dev/null 2>&1; then | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ | |
| | sh -s -- -y --default-toolchain none --profile minimal | |
| echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| fi | |
| rustup show | |
| - name: Cache unit tests | |
| # Six cases: put_then_lookup_roundtrips, list_uris_sorted, | |
| # missing_bytes_treated_as_miss, default_root_honors_overrides, | |
| # put_writes_both_blake3_and_sha256, purge_removes_everything. | |
| working-directory: host | |
| run: cargo test --lib cache --all-features | |
| compose-tests: | |
| name: Compose protocol unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install pinned Rust toolchain | |
| run: | | |
| if ! command -v rustup >/dev/null 2>&1; then | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ | |
| | sh -s -- -y --default-toolchain none --profile minimal | |
| echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| fi | |
| rustup show | |
| - name: Compose-provider unit tests | |
| # manifest_lists_methods, query_scalar_returns_count, | |
| # query_returns_rows, prepare_step_finalize_cycle. | |
| working-directory: host | |
| run: cargo test --lib compose_provider --all-features | |
| # Wasm-side build + extension-smoke live in a separate workflow: | |
| # .github/workflows/wasm-smoke.yml. It downloads wasi-sdk, installs | |
| # wasm-tools, builds every extension component, and runs the smoke | |
| # matrix. Catches WIT-skew regressions at PR time. |