-
Notifications
You must be signed in to change notification settings - Fork 14
95 lines (91 loc) · 3.25 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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:
name: SwiftWasm
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: 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