ndk: Mark all enums as non_exhaustive
and fix repr
types
#1982
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: [push, pull_request] | |
jobs: | |
formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Format | |
run: cargo fmt --all -- --check | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
target: aarch64-linux-android | |
- name: Clippy | |
# Use a cross-compilation target (that's typical for Android) to lint everything | |
run: cargo clippy --all --all-targets --all-features --target aarch64-linux-android -- -Dwarnings | |
check_ndk_sys_msrv: | |
name: Check ndk-sys MSRV (1.60.0) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/[email protected] | |
with: | |
target: aarch64-linux-android | |
- name: cargo check | |
run: cargo check -p ndk-sys --all-targets --all-features --target aarch64-linux-android | |
check_msrv: | |
strategy: | |
matrix: | |
minimal-versions: [true, false] | |
name: Check overall MSRV (1.66.0) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
if: ${{ matrix.minimal-versions }} | |
- name: Generate lockfile with minimal dependency versions | |
run: cargo +nightly generate-lockfile -Zminimal-versions | |
if: ${{ matrix.minimal-versions }} | |
- uses: dtolnay/[email protected] | |
with: | |
target: aarch64-linux-android | |
- name: cargo check | |
run: > | |
cargo check --workspace --all-targets --all-features --target aarch64-linux-android | |
|| (echo "::warning::MSRV test failed for minimal-versions: ${{ matrix.minimal-versions }}"; false) | |
continue-on-error: ${{ !matrix.minimal-versions }} | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
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 } | |
include: | |
- os: windows-latest | |
rust-channel: stable | |
rust-target: { triple: "aarch64-linux-android", abi: arm64-v8a } | |
- os: windows-latest | |
rust-channel: stable | |
rust-target: { triple: "x86_64-linux-android", abi: x86_64 } | |
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 }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
target: ${{ matrix.rust-target.triple }} | |
toolchain: ${{ matrix.rust-channel }} | |
- name: Compile for ${{ matrix.rust-target.triple }} | |
run: cargo ndk -t ${{ matrix.rust-target.abi }} build | |
build-host: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
rust-channel: [stable, nightly] | |
runs-on: ${{ matrix.os }} | |
name: Host-side tests | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Installing Rust ${{ matrix.rust-channel }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust-channel }} | |
- name: Test ndk-sys | |
run: cargo test -p ndk-sys --all-features | |
- name: Test ndk | |
run: cargo test -p ndk --all-features | |
docs: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
rust-channel: [stable, nightly] | |
runs-on: ${{ matrix.os }} | |
name: Build-test docs | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Installing Rust ${{ matrix.rust-channel }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust-channel }} | |
- name: Document all crates | |
env: | |
RUSTDOCFLAGS: -Dwarnings | |
run: cargo doc --all --all-features |