Skip to content

Commit 454cefc

Browse files
authored
Merge pull request #491 from hashgraph/sr/swift-rustless
2 parents be27fd6 + 49d8690 commit 454cefc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1754
-3131
lines changed

.github/workflows/rust-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
with:
1818
submodules: 'recursive'
1919
- name: Add `rustfmt` to toolchain
20-
run: rustup component add rustfmt
20+
run: rustup +nightly component add rustfmt
2121
- name: Format
22-
run: cargo fmt --check
22+
run: cargo +nightly fmt --check
2323

2424
check:
2525
runs-on: ubuntu-22.04

.github/workflows/swift-ci.yml

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,14 @@ name: Swift CI
22
on:
33
pull_request:
44
push:
5-
paths: ["sdk/rust/**", "protobufs/**", "sdk/swift/**"]
5+
paths: ["protobufs/**", "sdk/swift/**"]
66
branches: ['main']
77

88
defaults:
99
run:
1010
working-directory: sdk/swift
1111

1212
jobs:
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:
@@ -62,7 +23,6 @@ jobs:
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
@@ -77,18 +37,6 @@ jobs:
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
@@ -97,7 +45,7 @@ jobs:
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

Comments
 (0)