Skip to content

Merge pull request #228 from kkebo/6.1-wasmtime-29.0.1 #235

Merge pull request #228 from kkebo/6.1-wasmtime-29.0.1

Merge pull request #228 from kkebo/6.1-wasmtime-29.0.1 #235

Workflow file for this run

name: SwiftWasm
on:
push:
branches: ["wasm32-wasi-release/6.1"]
pull_request:
branches: ["wasm32-wasi-release/6.1"]
env:
SWIFT_SDK_URL: https://github.com/swiftwasm/swift/releases/download/swift-wasm-6.1-SNAPSHOT-2025-01-17-a/swift-wasm-6.1-SNAPSHOT-2025-01-17-a-wasm32-unknown-wasi.artifactbundle.zip
SWIFT_SDK_CHECKSUM: 706b61d890e8d7b68393d032903866d4c25fa7df79459f52d63f12e12611cba3
TARGET_TRIPLE: wasm32-unknown-wasi
WASMTIME_VESRION: 29.0.1
jobs:
build:
runs-on: ubuntu-latest
container: swiftlang/swift:nightly-6.1-jammy@sha256:063167a0a0677e2e3632c87b7fe81899352234719af48e88c8670782a8924cc8
env:
STACK_SIZE: 524288
steps:
- uses: actions/checkout@v4
- name: Install tools
run: apt-get update && apt-get install --no-install-recommends -y wabt binaryen
- run: swift --version
- run: swift sdk install $SWIFT_SDK_URL --checksum $SWIFT_SDK_CHECKSUM
- name: Build
run: |
swift build --product swift-format --swift-sdk $TARGET_TRIPLE -c release -Xlinker -z -Xlinker stack-size=$STACK_SIZE
wasm-strip .build/release/swift-format.wasm
wasm-opt -Oz --enable-bulk-memory --enable-sign-ext .build/release/swift-format.wasm -o swift-format.wasm
- name: Upload swift-format.wasm
uses: actions/upload-artifact@v4
with:
name: swift-format.wasm
path: swift-format.wasm
test-binary:
needs: build
runs-on: ubuntu-latest
container: swiftlang/swift:nightly-6.1-jammy@sha256:063167a0a0677e2e3632c87b7fe81899352234719af48e88c8670782a8924cc8
steps:
- uses: actions/checkout@v4
- uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: ${{ env.WASMTIME_VERSION }}
- run: wasmtime -V
- name: Download swift-format.wasm
uses: actions/download-artifact@v4
with:
name: swift-format.wasm
- run: wasmtime --dir . swift-format.wasm --version
- run: wasmtime --dir . swift-format.wasm lint -r .
test:
runs-on: ubuntu-latest
container: swiftlang/swift:nightly-6.1-jammy@sha256:063167a0a0677e2e3632c87b7fe81899352234719af48e88c8670782a8924cc8
env:
STACK_SIZE: 4194304
steps:
- uses: actions/checkout@v4
- uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: ${{ env.WASMTIME_VERSION }}
- run: swift --version
- run: wasmtime -V
- run: swift sdk install $SWIFT_SDK_URL --checksum $SWIFT_SDK_CHECKSUM
- run: swift build -c release --build-tests --swift-sdk $TARGET_TRIPLE -Xlinker -z -Xlinker stack-size=$STACK_SIZE
- run: wasmtime --dir / --wasm max-wasm-stack=$STACK_SIZE .build/release/swift-formatPackageTests.wasm