Skip to content

Commit 356c1bd

Browse files
committed
ci: add Android cross-compilation CI job
Add CI job that cross-compiles libbitcoinkernel-sys for three Android targets: aarch64-linux-android, armv7-linux-androideabi, and x86_64-linux-android.
1 parent 2b069b6 commit 356c1bd

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,45 @@ jobs:
211211
- name: Build and test
212212
run: cargo test -vv
213213

214+
215+
android-cross-compile:
216+
name: Cross-Compile for Android (${{ matrix.target }})
217+
runs-on: ubuntu-latest
218+
strategy:
219+
fail-fast: false
220+
matrix:
221+
target:
222+
- aarch64-linux-android
223+
- armv7-linux-androideabi
224+
- x86_64-linux-android
225+
steps:
226+
- uses: actions/checkout@v4
227+
228+
- name: Install Rust toolchain
229+
uses: dtolnay/rust-toolchain@stable
230+
with:
231+
targets: ${{ matrix.target }}
232+
233+
- name: Cache dependencies
234+
uses: Swatinem/rust-cache@v2
235+
236+
237+
- name: Install Boost library
238+
run: |
239+
sudo apt-get update
240+
sudo apt-get install -y libboost-all-dev
241+
242+
- name: Set up Android NDK
243+
uses: nttld/setup-ndk@v1
244+
id: setup-ndk
245+
with:
246+
ndk-version: r27c
247+
248+
- name: Build
249+
env:
250+
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
251+
run: cargo build -p libbitcoinkernel-sys --target ${{ matrix.target }} -vv
252+
214253
fuzz-corpus:
215254
name: Verify Fuzz Corpus
216255
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)