Skip to content

Commit cb3f3d5

Browse files
committed
ci(core): add wasm32-wasip2 build job
Adds a CI job to verify WASI P2 compatibility. This catches issues like the web_time cfg condition fix where web_time::web only exists for browser WASM (target_os = unknown), not WASI. Includes compatible layers and services that don't require reqwest/tokio: - layers: capability-check, chaos, concurrent-limit, immutable-index, logging, metrics, mime-guess, retry, throttle, timeout - services: dashmap, mini-moka
1 parent 97cb231 commit cb3f3d5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/ci_core.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,36 @@ jobs:
241241
rustup target add wasm32-unknown-unknown
242242
cargo build --target wasm32-unknown-unknown --no-default-features --features="${FEATURES[*]}" --locked
243243
244+
# Build under WASI to ensure WASI compatibility (uses std::time instead of web_time)
245+
build_under_wasi:
246+
runs-on: ubuntu-latest
247+
steps:
248+
- uses: actions/checkout@v6
249+
- name: Setup Rust toolchain
250+
uses: ./.github/actions/setup
251+
with:
252+
github-token: ${{ secrets.GITHUB_TOKEN }}
253+
- name: Build
254+
working-directory: core
255+
run: |
256+
FEATURES=(
257+
layers-capability-check
258+
layers-chaos
259+
layers-concurrent-limit
260+
layers-immutable-index
261+
layers-logging
262+
layers-metrics
263+
layers-mime-guess
264+
layers-retry
265+
layers-throttle
266+
layers-timeout
267+
services-dashmap
268+
services-mini-moka
269+
)
270+
rustup toolchain install nightly
271+
rustup target add wasm32-wasip2 --toolchain nightly
272+
cargo +nightly build --lib --target wasm32-wasip2 --no-default-features --features="${FEATURES[*]}" --locked
273+
244274
unit:
245275
runs-on: ubuntu-latest
246276
steps:

0 commit comments

Comments
 (0)