Skip to content

Commit

Permalink
CI: use cargo ndk to build android versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Aug 15, 2023
1 parent 419aea5 commit 6775ee1
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ jobs:
- x86_64-unknown-freebsd
- x86_64-unknown-illumos
- x86_64-unknown-netbsd
- x86_64-linux-android
- sparcv9-sun-solaris
versions:
- ""
Expand Down Expand Up @@ -135,6 +134,43 @@ jobs:

- run: cross build --target ${{ matrix.target }} --examples

build-android:
strategy:
fail-fast: false
matrix:
target:
- aarch64-linux-android
- armv7-linux-androideabi
- x86_64-linux-android
- i686-linux-android
versions:
- ""
- "-Zminimal-versions"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
run: |
rustup toolchain install stable --profile minimal --no-self-update --target ${{ matrix.target }}
- name: Update lockfile
run: cargo generate-lockfile ${{ matrix.versions }}
env:
RUSTC_BOOTSTRAP: 1
- name: Setup Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r25b

# See "build-cross" for an explanation
- name: Install "cargo ndk"
run: curl --location --silent --show-error --fail https://github.com/cargo-bins/cargo-quickinstall/releases/download/cargo-ndk-3.2.1/cargo-ndk-3.2.1-x86_64-unknown-linux-gnu.tar.gz | tar -xzvvf - -C $HOME/.cargo/bin

- name: Build library
run: cross ndk build --lib --target ${{ matrix.target }}
env:
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

build-ios-cross:
strategy:
fail-fast: false
Expand Down

0 comments on commit 6775ee1

Please sign in to comment.