@@ -2,53 +2,14 @@ name: Swift CI
22on :
33 pull_request :
44 push :
5- paths : ["sdk/rust/**", " protobufs/**", "sdk/swift/**"]
5+ paths : ["protobufs/**", "sdk/swift/**"]
66 branches : ['main']
77
88defaults :
99 run :
1010 working-directory : sdk/swift
1111
1212jobs :
13- # note: this isn't for distribution (it's for CI builds and tests), and compilation time is being preferred over runtime.
14- build-ffi :
15- strategy :
16- matrix :
17- target : [x86_64-apple-darwin, aarch64-apple-darwin]
18-
19- defaults :
20- run :
21- working-directory : sdk/rust
22-
23- runs-on : ubuntu-22.04
24- steps :
25- - uses : actions/checkout@v3
26- with :
27- submodules : ' recursive'
28-
29- - uses : Swatinem/rust-cache@v2
30- with :
31- workspaces : |
32- sdk/rust
33-
34- - name : Add target `${{ matrix.target }}`
35- run : rustup target add ${{ matrix.target }}
36- - name : Build for `${{ matrix.target }}`
37- run : cargo build -p hedera-crypto --target ${{ matrix.target }}
38-
39- - name : ' Upload `${{ matrix.target }}` Artifact'
40- uses : actions/upload-artifact@v3
41- with :
42- name : chedera-${{ matrix.target }}
43- path : sdk/rust/target/${{ matrix.target }}/debug/libhedera_crypto.a
44- retention-days : 1
45- - name : ' Upload `${{ matrix.target }}` Artifact'
46- uses : actions/upload-artifact@v3
47- with :
48- name : chedera-${{ matrix.target }}
49- path : sdk/c/include/hedera.h
50- retention-days : 1
51-
5213 format :
5314 runs-on : macos-12
5415 steps :
6223 strategy :
6324 matrix :
6425 swift : ["5.7"]
65- needs : build-ffi
6626 runs-on : macos-11
6727 steps :
6828 - uses : swift-actions/setup-swift@v1
7737 key : ${{ runner.os }}-${{ matrix.swift }}-spm-${{ github.job }}-${{ hashFiles('**/Package.resolved') }}
7838 restore-keys : |
7939 ${{ runner.os }}-${{ matrix.swift }}-spm-
80- - name : Download CHedera artifacts
81- uses : actions/download-artifact@v3
82- with :
83- path : .tmp/
84-
85- - name : merge into macos-universal
86- run : |
87- mkdir -p sdk/swift/CHedera.xcframework/macos-universal/Headers
88- cp sdk/swift/CHedera.xcframework/module.modulemap sdk/swift/CHedera.xcframework/macos-universal/headers
89- cp .tmp/chedera-aarch64-apple-darwin/hedera.h sdk/swift/CHedera.xcframework/macos-universal/headers
90- lipo .tmp/chedera-aarch64-apple-darwin/libhedera_crypto.a .tmp/chedera-x86_64-apple-darwin/libhedera_crypto.a -output sdk/swift/CHedera.xcframework/macos-universal/libhedera.a -create
91- working-directory : .
9240
9341 - name : Build
9442 run : swift build
9745 strategy :
9846 matrix :
9947 swift : ["5.7"]
100- needs : [build-ffi, build ]
48+ needs : [build]
10149 runs-on : macos-11
10250 steps :
10351 - uses : swift-actions/setup-swift@v1
@@ -112,19 +60,5 @@ jobs:
11260 restore-keys : |
11361 ${{ runner.os }}-${{ matrix.swift }}-spm-
11462
115-
116- - name : Download CHedera artifacts
117- uses : actions/download-artifact@v3
118- with :
119- path : .tmp/
120-
121- - name : merge into macos-universal
122- run : |
123- mkdir -p sdk/swift/CHedera.xcframework/macos-universal/Headers
124- cp sdk/swift/CHedera.xcframework/module.modulemap sdk/swift/CHedera.xcframework/macos-universal/headers
125- cp .tmp/chedera-aarch64-apple-darwin/hedera.h sdk/swift/CHedera.xcframework/macos-universal/headers
126- lipo .tmp/chedera-aarch64-apple-darwin/libhedera_crypto.a .tmp/chedera-x86_64-apple-darwin/libhedera_crypto.a -output sdk/swift/CHedera.xcframework/macos-universal/libhedera.a -create
127- working-directory : .
128-
12963 - name : Test
13064 run : swift test
0 commit comments