mirror of
https://github.com/rust-mobile/android-activity.git
synced 2026-07-10 00:37:28 +00:00
e5b8242ff2
cargo ndk will fail to build with 1.68 due to a toml_edit dep. Technically android-activity itself should still build with 1.68 but it's simpler to synchronize the `rust-version` with the minimum version that we actually test in CI (where we need to build cargo ndk)
108 lines
2.5 KiB
YAML
108 lines
2.5 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: '*'
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
RUSTFLAGS: "-C debuginfo=0 --deny warnings"
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# See top README for MSRV policy
|
|
rust-version: [1.69.0, stable]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: hecrj/setup-rust-action@v2
|
|
with:
|
|
rust-version: ${{ matrix.rust-version }}
|
|
|
|
- name: Install Rust targets
|
|
run: >
|
|
rustup target add
|
|
aarch64-linux-android
|
|
armv7-linux-androideabi
|
|
x86_64-linux-android
|
|
i686-linux-android
|
|
|
|
- name: Install cargo-ndk
|
|
run: cargo +stable install cargo-ndk
|
|
|
|
- name: Build game-activity
|
|
working-directory: android-activity
|
|
run: >
|
|
cargo ndk
|
|
-t arm64-v8a
|
|
-t armeabi-v7a
|
|
-t x86_64
|
|
-t x86
|
|
build --features game-activity
|
|
|
|
- name: Build native-activity
|
|
working-directory: android-activity
|
|
run: >
|
|
cargo ndk
|
|
-t arm64-v8a
|
|
-t armeabi-v7a
|
|
-t x86_64
|
|
-t x86
|
|
build --features native-activity
|
|
|
|
- name: Build agdk-mainloop example
|
|
if: matrix.rust-version == 'stable'
|
|
working-directory: examples/agdk-mainloop
|
|
run: >
|
|
cargo ndk
|
|
-t arm64-v8a
|
|
-t armeabi-v7a
|
|
-t x86_64
|
|
-t x86
|
|
-o app/src/main/jniLibs/ -- build
|
|
|
|
- name: Build na-mainloop example
|
|
if: matrix.rust-version == 'stable'
|
|
working-directory: examples/na-mainloop
|
|
run: >
|
|
cargo ndk
|
|
-t arm64-v8a
|
|
-t armeabi-v7a
|
|
-t x86_64
|
|
-t x86
|
|
-o app/src/main/jniLibs/ -- build
|
|
|
|
- name: Documentation
|
|
run: >
|
|
cargo ndk -t arm64-v8a doc --no-deps
|
|
|
|
format:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: rustfmt
|
|
|
|
- name: Format
|
|
run: cargo fmt --all -- --check
|
|
working-directory: android-activity
|
|
|
|
- name: Format na-mainloop example
|
|
run: cargo fmt --all -- --check
|
|
working-directory: examples/na-mainloop
|
|
|
|
- name: Format agdk-mainloop example
|
|
run: cargo fmt --all -- --check
|
|
working-directory: examples/agdk-mainloop
|