diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f531042..8db65de 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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: - "" @@ -135,6 +134,56 @@ 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 + - name: Add Rust components + run: rustup component add clippy rust-src + - name: Add Rust toolchain + run: rustup target add ${{ 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: Check + run: cargo ndk check --lib --target ${{ matrix.target }} + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + + - name: Clippy + run: cargo ndk clippy --lib --target ${{ matrix.target }} + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + + - name: Build library + run: cargo ndk build --lib --target ${{ matrix.target }} + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + build-ios-cross: strategy: fail-fast: false