Fix issue where struct associated values in enums couldn't be encoded/decoded automatically #684
Workflow file for this run
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: test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| automerge-dependencies: | |
| runs-on: macos-latest | |
| env: | |
| LOCAL_BUILD: true | |
| DEVELOPER_DIR: /Applications/Xcode.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) }}-{{ hashFiles(AutomergeUniffi/automergeFFI.h) }}-{{ hashFiles(rust/Cargo.lock) }}-{{ hashFiles(rust/src/doc.rs) }} | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: 1.89.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 | |
| if: steps.cache-automerge.outputs.cache-hit != 'true' | |
| with: | |
| name: libuniffi_automerge | |
| path: | | |
| libuniffi_automerge.a | |
| libuniffi_automerge_threads.a | |
| mac: | |
| runs-on: macos-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) }}-{{ hashFiles(AutomergeUniffi/automergeFFI.h) }}-{{ hashFiles(rust/Cargo.lock) }}-{{ hashFiles(rust/src/doc.rs) }} | |
| - name: Get swift version | |
| run: swift --version | |
| - name: Swift tests | |
| run: | | |
| export LOCAL_BUILD=true | |
| swift test | |
| wasm: | |
| runs-on: ubuntu-latest | |
| needs: automerge-dependencies | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: bytecodealliance/actions/wasmtime/setup@v1 | |
| - 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) }}-{{ hashFiles(AutomergeUniffi/automergeFFI.h) }}-{{ hashFiles(rust/Cargo.lock) }}-{{ hashFiles(rust/src/doc.rs) }} | |
| - uses: swift-actions/setup-swift@v3 | |
| with: | |
| swift-version: "6.2.3" | |
| - name: Install Swift SDK for WebAssembly | |
| run: swift sdk install https://download.swift.org/swift-6.2.3-release/wasm-sdk/swift-6.2.3-RELEASE/swift-6.2.3-RELEASE_wasm.artifactbundle.tar.gz --checksum 394040ecd5260e68bb02f6c20aeede733b9b90702c2204e178f3e42413edad2a | |
| - name: Build tests | |
| run: swift build --swift-sdk swift-6.2.3-RELEASE_wasm --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/wasm32-unknown-wasip1/debug/AutomergePackageTests.xctest | |
| rustfmt: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: 1.89.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.89.0 | |
| default: true | |
| components: clippy | |
| - name: Clippy | |
| run: ./scripts/ci/clippy.sh |