-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (54 loc) · 2.08 KB
/
lint+test.yml
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
name: Lint and Test
on:
push:
branches: main
pull_request:
jobs:
lint-and-test:
strategy:
matrix:
runner:
- macos-12 # X64
- macos-13 # X64
- macos-14 # ARM64
- ubuntu-latest
- windows-latest
rust-version:
- "1.72"
runs-on: "${{matrix.runner}}"
steps:
# TODO: Consider adding caching.
- name: Setup Rust
run: |
rustup default "${{matrix.rust-version}}"
rustup component add rustfmt clippy
- name: Check out sources
uses: actions/checkout@v4
with:
submodules: recursive
- name: Check formatting
run: cargo fmt --check
- name: Run linter
run: cargo clippy --all-targets --all-features -- -Dwarnings
- name: Run tests
run: cargo test
- name: Build Swift package (macOS/x86_64 only)
if: runner.os == 'macOS' && runner.arch == 'X64'
run: |
make swift-bindings lib-darwin-x86_64 # produces './generated/bindings' and './target/x86_64-apple-darwin/release/libconcordium_wallet_crypto_uniffi.a'
xcodebuild -create-xcframework \
-library ./target/x86_64-apple-darwin/release/libconcordium_wallet_crypto_uniffi.a -headers ./generated/bindings \
-output ./generated/ConcordiumWalletCryptoUniffi.xcframework
- name: Build Swift package (macOS/arm64 only)
if: runner.os == 'macOS' && runner.arch == 'ARM64'
run: |
make swift-bindings lib-darwin-aarch64 # produces './generated/bindings' and './target/aarch64-apple-darwin/release/libconcordium_wallet_crypto_uniffi.a'
xcodebuild -create-xcframework \
-library ./target/aarch64-apple-darwin/release/libconcordium_wallet_crypto_uniffi.a -headers ./generated/bindings \
-output ./generated/ConcordiumWalletCryptoUniffi.xcframework
- name: Verify that library builds (macOS only)
if: runner.os == 'macOS'
run: swift build
env:
# Use the local framework built in previous step.
CONCORDIUM_WALLET_CRYPTO_FRAMEWORK_PATH: ./generated/ConcordiumWalletCryptoUniffi.xcframework