mirror of
https://github.com/rust-mobile/android-activity.git
synced 2026-07-09 16:27:28 +00:00
db3ea3386f
There was a fix for the definition of the `stat` struct on Android in 1.73, and even though it's unlikely to affect many applications it still seems worthwhile to draw a line under this and ensure that all android-activity based applications will have that fix. Rust 1.73 was released October 2023, which is still well over a year old and very conservative. This updates `generate-bindings.sh` to pass `--rust-target 1.73.0` so we avoid generating bindings that require a more recent compiler. (This doesn't actually regenerate the bindings but does ensure that future updates will be constrained to generate code that is backwards compatible with 1.73.)
115 lines
3.0 KiB
YAML
115 lines
3.0 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.73.0, stable]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# Downgrade all dependencies to their minimum version, both to ensure our
|
|
# minimum version bounds are correct and buildable, as well as to satisfy
|
|
# our MSRV check when arbitrary dependencies bump their MSRV beyond our
|
|
# MSRV in a patch-release.
|
|
# This implies that downstream consumers can only rely on our MSRV when
|
|
# downgrading various (transitive) dependencies.
|
|
- uses: hecrj/setup-rust-action@v2
|
|
with:
|
|
rust-version: nightly
|
|
if: ${{ matrix.rust-version != 'stable' }}
|
|
- name: Downgrade dependencies
|
|
run: cargo +nightly generate-lockfile -Zminimal-versions
|
|
if: ${{ matrix.rust-version != 'stable' }}
|
|
|
|
- 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
|
|
|
|
- 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
|