Skip to content

Prevents coupling UTF-16 text value encodings to WASM targets #578

Prevents coupling UTF-16 text value encodings to WASM targets

Prevents coupling UTF-16 text value encodings to WASM targets #578

Workflow file for this run

name: test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-test:
runs-on: macos-14
env:
LOCAL_BUILD: true
DEVELOPER_DIR: /Applications/Xcode_15.4.app
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.78.0
default: true
- name: get xcode information
run: |
xcodebuild -version
swift --version
- name: build xcframework
run: ./scripts/build-xcframework.sh
- name: compress framework
run: ./scripts/compress-framework.sh
- name: Swift tests
run: swift test
wasm:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- toolchain: swift-DEVELOPMENT-SNAPSHOT-2024-10-08-a
swift-sdk: swift-wasm-DEVELOPMENT-SNAPSHOT-2024-10-15-a
checksum: e27d5df268cc9ecab2f5bca8ca693c8b684015de60593e1d472a78ce28ed9283
steps:
- uses: actions/checkout@v4
- uses: bytecodealliance/actions/wasmtime/setup@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.78.0
default: true
- run: rustup target add wasm32-wasip1-threads
- name: Install Swift and Swift SDK for WebAssembly
run: |
PREFIX=/opt/swift
SWIFT_TOOLCHAIN_TAG="${{ matrix.toolchain }}"
SWIFT_SDK_TAG="${{ matrix.swift-sdk }}"
set -ex
curl -f -o /tmp/swift.tar.gz "https://download.swift.org/development/ubuntu2204/$SWIFT_TOOLCHAIN_TAG/$SWIFT_TOOLCHAIN_TAG-ubuntu22.04.tar.gz"
sudo mkdir -p $PREFIX; sudo tar -xzf /tmp/swift.tar.gz -C $PREFIX --strip-component 1
$PREFIX/usr/bin/swift sdk install "https://github.com/swiftwasm/swift/releases/download/$SWIFT_SDK_TAG/$SWIFT_SDK_TAG-wasm32-unknown-wasip1-threads.artifactbundle.zip" --checksum ${{ matrix.checksum }}
echo "$PREFIX/usr/bin" >> $GITHUB_PATH
#- run: cargo build --manifest-path rust/Cargo.toml --target wasm32-wasip1-threads --release
- run: scripts/ci/wasi-regen-swift.sh
- uses: actions/upload-artifact@v4
with:
name: libuniffi_automerge-wasm32-wasip1-threads.a
path: ./rust/target/wasm32-wasip1-threads/release/libuniffi_automerge.a
- name: Build tests
run: |
pwd
ls
swift build --swift-sdk wasm32-unknown-wasip1-threads --build-tests -Xlinker libuniffi_automerge.a -Xlinker -z -Xlinker stack-size=$((1024 * 1024))
- name: Run tests
run: wasmtime run --wasm max-wasm-stack=$((1024 * 1024)) --wasm threads --wasi threads --dir . .build/debug/AutomergePackageTests.wasm
rustfmt:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.78.0
default: true
components: rustfmt
- name: Clippy
run: ./scripts/ci/rustfmt.sh
clippy:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.78.0
default: true
components: clippy
- name: Clippy
run: ./scripts/ci/clippy.sh