Update zwasm to v1.3.0 #63
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: | |
| branches: [main] | |
| jobs: | |
| test-macos: | |
| runs-on: macos-14 # Apple Silicon (M1) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.15.2 | |
| - name: Run tests | |
| run: zig build test | |
| - name: Build ReleaseSafe | |
| run: zig build -Doptimize=ReleaseSafe | |
| - name: Smoke test | |
| run: | | |
| ./zig-out/bin/cljw -e '(+ 1 2 3)' | |
| ./zig-out/bin/cljw -e '(println "CI pass")' | |
| - name: Binary size check | |
| run: | | |
| SIZE=$(stat -f%z zig-out/bin/cljw) | |
| SIZE_MB=$(echo "scale=2; $SIZE / 1048576" | bc) | |
| echo "Binary size: ${SIZE_MB}MB ($SIZE bytes)" | |
| # Threshold: 4.8MB (baseline ~4.5MB, see .dev/baselines.md) | |
| if [ "$SIZE" -gt 5033164 ]; then | |
| echo "FAIL: Binary size ${SIZE_MB}MB exceeds 4.8MB threshold" | |
| exit 1 | |
| fi | |
| - name: E2E tests | |
| run: bash test/e2e/run_e2e.sh | |
| - name: Deps E2E tests | |
| run: bash test/e2e/deps/run_deps_e2e.sh | |
| - name: Benchmark smoke test | |
| run: | | |
| echo "Running benchmark smoke tests (10s timeout per benchmark)..." | |
| # macOS doesn't have GNU timeout; use perl-based fallback | |
| run_with_timeout() { | |
| perl -e 'alarm 10; exec @ARGV' -- "$@" | |
| } | |
| PASS=0 | |
| FAIL=0 | |
| for dir in bench/benchmarks/*/; do | |
| [ -f "$dir/bench.clj" ] || continue | |
| name=$(basename "$dir" | sed 's/^[0-9]*_//') | |
| # Skip wasm benchmarks (require wasm test files) | |
| case "$name" in wasm_*) continue ;; esac | |
| printf " %-24s " "$name" | |
| if run_with_timeout ./zig-out/bin/cljw "$dir/bench.clj" >/dev/null 2>&1; then | |
| echo "OK" | |
| PASS=$((PASS + 1)) | |
| else | |
| echo "FAIL" | |
| FAIL=$((FAIL + 1)) | |
| fi | |
| done | |
| echo "" | |
| echo "Benchmarks: $PASS passed, $FAIL failed" | |
| if [ "$FAIL" -gt 0 ]; then | |
| exit 1 | |
| fi | |
| test-linux: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.15.2 | |
| - name: Run tests | |
| run: zig build test | |
| - name: Build ReleaseSafe | |
| run: zig build -Doptimize=ReleaseSafe | |
| - name: Smoke test | |
| run: | | |
| ./zig-out/bin/cljw -e '(+ 1 2 3)' | |
| ./zig-out/bin/cljw -e '(println "CI pass")' | |
| - name: Binary size check | |
| run: | | |
| RAW_SIZE=$(stat -c%s zig-out/bin/cljw) | |
| RAW_MB=$(echo "scale=2; $RAW_SIZE / 1048576" | bc) | |
| echo "Binary size (raw): ${RAW_MB}MB ($RAW_SIZE bytes)" | |
| # Linux ELF includes debug info in ReleaseSafe; check stripped size | |
| cp zig-out/bin/cljw /tmp/cljw_stripped | |
| strip /tmp/cljw_stripped | |
| SIZE=$(stat -c%s /tmp/cljw_stripped) | |
| SIZE_MB=$(echo "scale=2; $SIZE / 1048576" | bc) | |
| echo "Binary size (stripped): ${SIZE_MB}MB ($SIZE bytes)" | |
| # Threshold: 4.8MB stripped (baseline ~4.5MB, see .dev/baselines.md) | |
| if [ "$SIZE" -gt 5033164 ]; then | |
| echo "FAIL: Stripped binary ${SIZE_MB}MB exceeds 4.8MB threshold" | |
| exit 1 | |
| fi | |
| - name: E2E tests | |
| run: bash test/e2e/run_e2e.sh | |
| - name: Deps E2E tests | |
| run: bash test/e2e/deps/run_deps_e2e.sh | |
| cross-compile: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| target: | |
| - x86_64-linux-gnu | |
| - aarch64-linux-gnu | |
| - x86_64-macos-none | |
| - aarch64-macos-none | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.15.2 | |
| - name: Cross-compile | |
| run: zig build -Dtarget=${{ matrix.target }} -Doptimize=ReleaseSafe | |
| - name: Check binary | |
| run: file zig-out/bin/cljw && ls -lh zig-out/bin/cljw |