mirror of
https://github.com/rust-mobile/android-activity.git
synced 2026-07-09 16:27:28 +00:00
2e279210a3
Most of the examples weren't strictly just demonstrating how to use the android-activity API - rather they demonstrated using other libraries in conjunction with android-activity. Most of the examples have now been split into a standalone repository under: https://github.com/rust-mobile/rust-android-examples The na-mainloop and agdk-mainloop examples have been kept here since they can be built against the local/in-tree version of android-activity and are useful to keep for CI purposes. This also runs `cargo update` for the na-mainloop and agdk-mainloop.
119 lines
2.8 KiB
YAML
119 lines
2.8 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:
|
|
# We need to support the same MSRV as Winit which we are currently
|
|
# assuming will be bumped to 1.60.0 soon:
|
|
# https://github.com/rust-windowing/winit/pull/2453
|
|
rust_version: [1.60.0, stable]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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
|
|
run: cargo install cargo-ndk
|
|
|
|
- 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@v2
|
|
|
|
- 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
|