@@ -2,21 +2,45 @@ name: wasm
22
33on :
44 push :
5- pull_request :
5+
6+ env :
7+ # Required Swift toolchain version for WASM builds
8+ # Must match REQUIRED_TOOLCHAIN_VERSION in scripts/build-and-test-wasm.sh
9+ SWIFT_TOOLCHAIN_VERSION : " DEVELOPMENT-SNAPSHOT-2025-11-03-a"
10+ # Checksum for the WASM SDK (from SwiftWasm release page)
11+ SWIFT_WASM_SDK_CHECKSUM : " 879c08f24c36e20e0b3d1fadc37f4c34c089c72caa018aec726d9e0bf84ea6ff"
612
713jobs :
814 build :
9- runs-on : macos-latest
10-
15+ runs-on : ubuntu-24.04
1116 steps :
1217 - uses : actions/checkout@v4
1318
14- # Use Swift 6.0.3 to match the pinned SDK version in build-and-test-wasm.sh
15- # The script will automatically install the 6.0.3-RELEASE WASM SDK
16- - name : Install Swift
17- uses : swift-actions/setup-swift@v2
18- with :
19- swift-version : " 6.1"
19+ # Install the specific Swift development snapshot required for WASM builds
20+ # Toolchain comes from swift.org, SDK comes from SwiftWasm
21+ - name : Install Swift Toolchain
22+ run : |
23+ SWIFT_URL="https://download.swift.org/development/ubuntu2404/swift-${SWIFT_TOOLCHAIN_VERSION}/swift-${SWIFT_TOOLCHAIN_VERSION}-ubuntu24.04.tar.gz"
24+ echo "Downloading Swift toolchain from: $SWIFT_URL"
25+ mkdir -p /opt/swift
26+ curl -sL "$SWIFT_URL" | tar xz --strip-components=1 -C /opt/swift
27+ echo "/opt/swift/usr/bin" >> $GITHUB_PATH
28+
29+ - name : Verify Swift Installation
30+ run : swift --version
31+
32+ # Install the matching WASM SDK from SwiftWasm
33+ - name : Install WASM SDK
34+ run : |
35+ SDK_URL="https://github.com/swiftwasm/swift/releases/download/swift-wasm-${SWIFT_TOOLCHAIN_VERSION}/swift-wasm-${SWIFT_TOOLCHAIN_VERSION}-wasm32-unknown-wasip1-threads.artifactbundle.zip"
36+ echo "Installing WASM SDK from: $SDK_URL"
37+ swift sdk install "$SDK_URL" --checksum "$SWIFT_WASM_SDK_CHECKSUM"
38+ echo "Installed SDKs:"
39+ swift sdk list
40+
41+ # Set environment variable to signal the correct toolchain is installed
42+ - name : Set Toolchain Environment
43+ run : echo "SWIFT_WASM_TOOLCHAIN_VERIFIED=1" >> $GITHUB_ENV
2044
2145 # Wasmtime is required because `swift test` doesn't work for WebAssembly targets.
2246 # For WASM, we must build tests separately and run them with a WASM runtime.
0 commit comments