Files
faunosteo/scripts/rust-check.sh
T
bchanot f8579bc19a feat(domain): R4.2d attachment probe, import_pdf and SheetHandle.import_pdf on the wasm facade
locate_attachment (shared 16 MiB budget, JS-path steps in the TypeScript order, OD-3 cap
hook off until measured), pdf::import, facade import_pdf with the PdfImportKind kinds
(ts-rs exported). cargo: O7 144 inputs (locate, read, archive rows) and O8 51 cases equal
to the R3 path, 3 OD-4 differences declared (lone surrogate in an overwritten duplicate
value). Node through the shipped module: the same O8 outcomes, every reference PDF.
Module 421.7 KB gzip (W1 budget 600 KB).
2026-10-18 15:55:46 +02:00

28 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# The Rust quality gate, one file for every environment: `pnpm rust:check` runs it on the
# native toolchain of the development machine (rustup selects the channel pinned by
# rust-toolchain.toml); `pnpm rust:check:docker` runs the same file inside the reference
# builder image (docker/rust-builder.Dockerfile) when a reproducible run is wanted.
# The worker's sandbox tests are feature-gated (`test-hooks`) and run only in its own
# Alpine/musl image (crates/worker/Dockerfile stage `test`, `pnpm worker:test`): the seccomp
# allowlist is derived for the musl static binary that ships. The plain `cargo test` below
# therefore covers the worker's unit tests and the whole of core and wasm.
set -euo pipefail
cd "$(dirname "$0")/.."
. scripts/rust-env.sh
cargo fmt --all --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
# The PDF reader (R4) is feature-gated in the core: its code and suites compile only here
# and in the wasm module, never in the worker.
cargo clippy -p faunosteo-core --all-targets --features pdf-read --locked -- -D warnings
cargo test -p faunosteo-core --features pdf-read --locked
# Exports the TypeScript types of the contracts (ts-rs) into packages/core-wasm/types.
# `git status --porcelain --untracked-files=all -- packages/core-wasm/types` must stay
# empty afterwards (scripts/check-all.sh, .gitea/workflows/ci.yml): the committed types
# never drift from the Rust structs, and a new type file counts as drift.
cargo test -p faunosteo-core --features ts,pdf-read --locked
cargo deny check licenses bans sources