Skip to content

Commit

Permalink
CI: Drop unneeded cargo-ndk tool from build-test (#476)
Browse files Browse the repository at this point in the history
A recent borked `cargo-ndk` release [^1] [^2] lead me to investigate
why we are using a nonstandard tool in our CI in the first place.
Compiling / build-testing the `ndk` crate does not require any external
tooling whatsoever nor an SDK setup: this crate is a pure wrapper over
pre-generated C bindings in the `ndk-sys` crate, which only require
NDK _libraries_ (and an Android-capable linker) when linking actual
runnable binaries (typically shared libraries or executables).  And the
Rust compiler natively supports compiling Rust code for Android targets.

[^1]: https://github.com/rust-mobile/ndk/actions/runs/9149848316
[^2]: https://togithub.com/bbqsrc/cargo-ndk/pull/135#discussion_r1606097922
  • Loading branch information
MarijnS95 authored May 19, 2024
1 parent 10bce81 commit f964154
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,38 +70,32 @@ jobs:
os: [ubuntu-latest]
rust-channel: [stable, nightly]
rust-target:
- { triple: "armv7-linux-androideabi", abi: armeabi-v7a }
- { triple: "aarch64-linux-android", abi: arm64-v8a }
- { triple: "i686-linux-android", abi: x86 }
- { triple: "x86_64-linux-android", abi: x86_64 }
- armv7-linux-androideabi
- aarch64-linux-android
- i686-linux-android
- x86_64-linux-android
include:
- os: windows-latest
rust-channel: stable
rust-target: { triple: "aarch64-linux-android", abi: arm64-v8a }
rust-target: aarch64-linux-android
- os: windows-latest
rust-channel: stable
rust-target: { triple: "x86_64-linux-android", abi: x86_64 }
rust-target: x86_64-linux-android

runs-on: ${{ matrix.os }}
name: Cross-compile

steps:
- uses: actions/checkout@v4

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Install cargo-ndk
run: cargo install cargo-ndk

- name: Installing Rust ${{ matrix.rust-channel }} w/ ${{ matrix.rust-target.triple }}
- name: Installing Rust ${{ matrix.rust-channel }} w/ ${{ matrix.rust-target }}
uses: dtolnay/rust-toolchain@master
with:
target: ${{ matrix.rust-target.triple }}
target: ${{ matrix.rust-target }}
toolchain: ${{ matrix.rust-channel }}

- name: Compile for ${{ matrix.rust-target.triple }}
run: cargo ndk -t ${{ matrix.rust-target.abi }} build
- name: Compile for ${{ matrix.rust-target }}
run: cargo build --target ${{ matrix.rust-target }}

build-host:
strategy:
Expand Down

0 comments on commit f964154

Please sign in to comment.