mirror of
https://github.com/rust-mobile/android-activity.git
synced 2026-07-09 16:27:28 +00:00
1abb02c820
This effectively reverts 66cfc68dac
and adds some comments explaining that we're currently blocked by
Winit's MSRV policy + CI from being able to increase our
rust-version.
This is a frustrating conflict that I hope can be addressed by
updating Winit's CI system to allow different platforms to require
more recent versions of Rust (which notably isn't in conflict with
setting a conservative rust-version in Winit for supporting Debian
on Linux)
This re-instates building android-activity with cargo-ndk 2 because
building on Android with 1.64 requires a linker workaround that's
not implemented in newer version of cargo-ndk.
This also reinstates the clippy false-negative warning suppression
for unsafe blocks. Again it's frustrating that we can't have good
things because of how Winit wants to support Debian which shouldn't
be relevant for Android development.
Here is an upstream issue to discuss a potential solution for this:
https://github.com/rust-windowing/winit/issues/3000
121 lines
3.0 KiB
YAML
121 lines
3.0 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
RUSTFLAGS: "-C debuginfo=0 --deny warnings"
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# XXX: We are currently constrained by Winit's MSRV policy + CI system
|
|
# See Cargo.toml for details
|
|
rust_version: [1.64.0, stable]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: hecrj/setup-rust-action@v1
|
|
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
|
|
# XXX: We have to use an old version of cargo-ndk that supports the
|
|
# libgcc linker workaround for rust < 1.68 because Winit's CI system
|
|
# currently requires this crate to be buildable with 1.64
|
|
run: cargo install cargo-ndk --version "^2"
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v2
|
|
|
|
- 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@v3
|
|
|
|
- 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
|