forked from sneurlax/seeker
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (99 loc) · 3.44 KB
/
Copy pathci.yml
File metadata and controls
105 lines (99 loc) · 3.44 KB
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
96
97
98
99
100
101
102
103
104
105
name: CI
# CI for the seeker monorepo: Rust crates under native/ and the Dart/Flutter
# pub workspace driven by melos (scripts live in the root pubspec.yaml).
#
# NOTE: a `precompile` workflow (cargokit precompiled seed_vault_core
# binaries uploaded to a GitHub release, like sound's precompile.yml) is
# intentionally deferred: it requires a CARGOKIT_PRIVATE_KEY repository
# secret (the hex private key from cargokit's `build_tool gen-key`) plus a
# cargokit.yaml public_key for verification. Add it once that secret exists.
on:
push:
branches: [main]
pull_request:
# Cancel superseded runs on the same ref.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
name: Rust (${{ matrix.crate }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# No root Cargo workspace: build/test each crate by manifest path.
crate: [seed_vault_core, seed_vault_cli]
defaults:
run:
working-directory: native/${{ matrix.crate }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
native/seed_vault_core
native/seed_vault_cli
- run: cargo fmt --all --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo test
# seed_vault_core must also compile for Android with the JNI adapter
# (feature `android`, optional jni dependency).
- if: matrix.crate == 'seed_vault_core'
run: rustup target add aarch64-linux-android
- if: matrix.crate == 'seed_vault_core'
run: cargo check --target aarch64-linux-android --features android
analyze-test:
name: Analyze & test (Dart/Flutter)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# cargokit (plugin build tooling) and the Seed Vault SDK are
# submodules.
submodules: true
- uses: subosito/flutter-action@v2
with:
channel: stable
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
native/seed_vault_core
native/seed_vault_cli
# The pub workspace includes Flutter packages, so resolve with Flutter.
- run: flutter pub get
# seed_vault_dart's native (FFI) tests need the seed_vault_core dylib;
# build it before running the test script.
- run: dart run melos run native:build
- run: dart run melos run analyze
- name: Check formatting
run: dart run melos run format
- run: dart run melos run test
# Future job: Android build (gradle / `flutter build apk` for
# packages/seeker/example). Deferred: needs the Android
# SDK/NDK on the runner and the Seed Vault SDK wiring verified; no
# emulator/device tests in CI yet.
#
# android:
# name: Build example (apk)
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: subosito/flutter-action@v2
# with:
# channel: stable
# - uses: dtolnay/rust-toolchain@stable
# - uses: nttld/setup-ndk@v1
# id: ndk
# with:
# ndk-version: r26d
# - run: flutter pub get
# - name: Build apk
# working-directory: packages/seeker/example
# run: flutter build apk --debug