@@ -41,11 +41,14 @@ jobs:
4141 shared-key : rust-ci
4242
4343 - name : Run Rust tests
44- run : |
45- cargo test -p fula-flutter --lib
46- cargo test -p fula-js --lib
47- cargo test -p fula-client --lib
48- cargo test -p fula-crypto --lib
44+ # `--workspace --all-targets` covers lib + integration tests under each
45+ # crate's tests/ AND the workspace-root tests/. The previous
46+ # `-p X --lib` form silently excluded tests/migration_tests.rs and the
47+ # rest of the integration suite, so bugs that integration tests would
48+ # have caught (including v1→v7 migration correctness on native) never
49+ # gated PRs. `--no-fail-fast` lets every failure report on the first
50+ # run with the broader scope.
51+ run : cargo test --workspace --all-targets --no-fail-fast
4952
5053 # Test WASM compilation (fula-js npm package)
5154 test-wasm :
7982 grep -q "deriveKey" crates/fula-js/pkg/fula_js.d.ts
8083 echo "All expected exports found!"
8184
85+ # Layer 1: ban panic-on-wasm stdlib time APIs at compile time.
86+ # The disallowed-methods config lives at `.github/clippy-wasm/clippy.toml`
87+ # and is loaded only here via `CLIPPY_CONF_DIR`, so native clippy never
88+ # sees the bans (cfg(not(target_arch = "wasm32"))-gated heartbeat / WAL /
89+ # retry-backoff code in encryption.rs is free to keep using SystemTime).
90+ # Two clippy invocations are needed because fula-crypto's default features
91+ # include `tokio-runtime`, which doesn't compile on wasm32. The other
92+ # crates pull fula-crypto with `default-features = false, features = ["wasm"]`
93+ # via target-conditional deps, but a direct `-p fula-crypto` would use its
94+ # own defaults. We use `-D clippy::disallowed_methods` (not `-D warnings`)
95+ # to scope the failure mode to the panic-on-wasm bug class only — pre-existing
96+ # style/idiom warnings in the workspace shouldn't gate this PR.
97+ #
98+ # `--lib` only: integration tests under `tests/` pull in tokio with full
99+ # features and don't compile on wasm32. The lint applies to library code,
100+ # which is what actually ships into the browser bundle.
101+ - name : WASM clippy — fula-client / fula-flutter / fula-js
102+ env :
103+ CLIPPY_CONF_DIR : ${{ github.workspace }}/.github/clippy-wasm
104+ run : |
105+ cargo clippy --target wasm32-unknown-unknown \
106+ -p fula-client -p fula-flutter -p fula-js \
107+ --lib -- -D clippy::disallowed_methods
108+
109+ - name : WASM clippy — fula-crypto (forced wasm features)
110+ env :
111+ CLIPPY_CONF_DIR : ${{ github.workspace }}/.github/clippy-wasm
112+ run : |
113+ cargo clippy --target wasm32-unknown-unknown \
114+ -p fula-crypto --no-default-features --features wasm \
115+ --lib -- -D clippy::disallowed_methods
116+
117+ # Layer 2: actually exercise the time wiring at runtime in a browser.
118+ # Catches dependency-config regressions clippy can't see (e.g. someone
119+ # later sets default-features = false on chrono and drops `wasmbind`).
120+ - name : Install Firefox + geckodriver for wasm-pack test
121+ uses : browser-actions/setup-firefox@v1
122+ - name : WASM runtime smoke tests
123+ run : wasm-pack test --headless --firefox crates/fula-flutter
124+
82125 # Generate and validate Dart bindings
83126 generate-bindings :
84127 runs-on : ubuntu-latest
0 commit comments