Prevents coupling UTF-16 text value encodings to WASM targets #584
Workflow file for this run
This file contains 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: test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
automerge-dependencies: | |
runs-on: macos-14 | |
env: | |
LOCAL_BUILD: true | |
DEVELOPER_DIR: /Applications/Xcode_15.4.app | |
concurrency: | |
group: automerge-dependencies-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Automerge XCFramework and library | |
id: cache-automerge | |
uses: actions/cache@v4 | |
with: | |
path: | | |
automergeFFI.xcframework | |
automergeFFI.xcframework.zip | |
libuniffi_automerge.a | |
libuniffi_automerge_threads.a | |
key: automerge-dependencies-{{ hashFiles(AutomergeUniffi/automerge.swift) }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: 1.81.0 | |
default: true | |
- name: Build Automerge XCFramework and library | |
if: steps.cache-automerge.outputs.cache-hit != 'true' | |
run: ./scripts/build-xcframework.sh | |
- name: Compress Automerge XCFramework | |
if: steps.cache-automerge.outputs.cache-hit != 'true' | |
run: ./scripts/compress-framework.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: libuniffi_automerge | |
path: | | |
libuniffi_automerge.a | |
libuniffi_automerge_threads.a | |
test-automerge-swift: | |
runs-on: macos-14 | |
needs: automerge-dependencies | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore Automerge XCFramework and library | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
automergeFFI.xcframework | |
automergeFFI.xcframework.zip | |
libuniffi_automerge.a | |
libuniffi_automerge_threads.a | |
key: automerge-dependencies-{{ hashFiles(AutomergeUniffi/automerge.swift) }} | |
- name: Swift tests | |
run: swift test | |
test-automerge-wasm: | |
runs-on: ubuntu-latest | |
container: swiftwasm/swift:latest | |
needs: automerge-dependencies | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore Automerge XCFramework and library | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
automergeFFI.xcframework | |
automergeFFI.xcframework.zip | |
libuniffi_automerge.a | |
libuniffi_automerge_threads.a | |
key: automerge-dependencies-{{ hashFiles(AutomergeUniffi/automerge.swift) }} | |
- name: Build tests | |
run: swift build --swift-sdk wasm32-wasip1 --build-tests -Xlinker "`pwd`/libuniffi_automerge.a" -Xlinker -z -Xlinker stack-size=$((1024 * 1024)) | |
- name: Run tests | |
run: wasmtime run --wasm max-wasm-stack=$((1024 * 1024)) --dir . .build/debug/AutomergePackageTests.wasm | |
rustfmt: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: 1.81.0 | |
default: true | |
components: rustfmt | |
- name: Clippy | |
run: ./scripts/ci/rustfmt.sh | |
clippy: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: 1.81.0 | |
default: true | |
components: clippy | |
- name: Clippy | |
run: ./scripts/ci/clippy.sh |