trigger CI #1682
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: CI | |
on: | |
merge_group: | |
pull_request: | |
push: | |
env: | |
CARGO_TERM_COLOR: always | |
# If nightly is breaking CI, modify this variable to target a specific nightly version. | |
NIGHTLY_TOOLCHAIN: nightly | |
concurrency: | |
group: ${{github.workflow}}-${{github.ref}} | |
cancel-in-progress: ${{github.event_name == 'pull_request'}} | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install Linux dependencies | |
uses: ./.github/actions/install-linux-deps | |
- name: Build & run tests | |
# See tools/ci/src/main.rs for the commands this runs | |
run: cargo run -p ci -- test | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: "-C debuginfo=0 -D warnings" | |
ci: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.toml') }} | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: Install Linux dependencies | |
uses: ./.github/actions/install-linux-deps | |
with: | |
wayland: true | |
xkb: true | |
- name: CI job | |
# See tools/ci/src/main.rs for the commands this runs | |
run: cargo run -p ci -- lints | |
build-android: | |
if: ${{ github.event_name == 'merge_group' }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-build-android-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install Android targets | |
run: rustup target add aarch64-linux-android | |
- name: Install Cargo NDK | |
run: cargo install --force cargo-ndk | |
- name: Build .so file | |
run: cargo ndk -t arm64-v8a -o android_example/app/src/main/jniLibs build --package bevy_mobile_example | |
- name: Build app for Android | |
run: cd examples/mobile/android_example && chmod +x gradlew && ./gradlew build |