Skip to content

Commit

Permalink
Cross platform builds in CI (#133)
Browse files Browse the repository at this point in the history
This PR adds a GH workflow that builds across platforms, specifically the android platforms referenced in the cross_build.sh scripts, but can be extended to build for others. It seems like one of the next steps is to hook up version publishing in general for these packages/platforms, but this PR just focuses on getting the builds running in CI for continuous validation/testing and further iteration. The builds are still relatively slow in CI, taking about 15 minutes to complete, but not nearly as slow as when running locally on a mac via qemu.

https://github.com/bitcoindevkit/bdk-ffi/blob/master/.github/workflows/publish-android.yaml seems like a good example of the full build + publish workflow that we'd want to evolve this into.

Note that the `x86_64-linux-android` build is failing, with some context in #134. I spent some time trying to figure this out, unsuccessfully, and ultimately decided to spin up an issue to track it separately and get a PR up for the builds that work.
  • Loading branch information
snormore authored Jun 12, 2023
1 parent b1dda82 commit 603d534
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build
on:
pull_request:
push:
branches:
- main
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [
aarch64-unknown-linux-gnu,
# x86_64-linux-android,
i686-linux-android,
armv7-linux-androideabi,
aarch64-linux-android,
]
steps:
- name: Checkout
uses: actions/checkout@v1

- name: "Cache"
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
./target/${{ matrix.target }}
key: ${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}

# Install latest cross to mitigate unwind linking issue on android builds.
# See https://github.com/cross-rs/cross/issues/1222
- name: Install rust cross
run: |
cargo install cross --git https://github.com/cross-rs/cross
- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }} --manifest-path bindings_ffi/Cargo.toml --target-dir bindings_ffi/target
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion xmtp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ tempfile = "3.5.0"

[dependencies.libsqlite3-sys]
version = "0.26.0"
features = ["bundled-sqlcipher"]
features = ["bundled-sqlcipher-vendored-openssl"]

0 comments on commit 603d534

Please sign in to comment.