| 1 | name: CI |
| 2 | |
| 3 | # Formatting, lints and tests on every push to master and every pull request. |
| 4 | |
| 5 | on: |
| 6 | push: |
| 7 | branches: [master] |
| 8 | pull_request: |
| 9 | |
| 10 | jobs: |
| 11 | check: |
| 12 | runs-on: ubuntu-22.04 |
| 13 | steps: |
| 14 | - uses: actions/checkout@v6 |
| 15 | - uses: dtolnay/rust-toolchain@stable |
| 16 | with: |
| 17 | components: clippy, rustfmt |
| 18 | targets: aarch64-linux-android |
| 19 | - run: sudo apt-get update && sudo apt-get install -y pkg-config libwayland-dev libxkbcommon-dev |
| 20 | - run: cargo fmt --all -- --check |
| 21 | - run: cargo clippy --workspace --all-targets --locked -- -D warnings |
| 22 | # The core also goes into the Android app (docs/android.md). A check needs no NDK. |
| 23 | - run: cargo clippy -p budctl-core --target aarch64-linux-android --locked -- -D warnings |
| 24 | - run: cargo test --workspace --locked |
| 25 | - run: sh -n install.sh |
| 26 | |
| 27 | # The Android app: its Rust library (debug, for the phone and the emulator), the app and its JVM |
| 28 | # tests. The manifest check (no INTERNET) runs with the build. |
| 29 | android: |
| 30 | runs-on: ubuntu-24.04 |
| 31 | steps: |
| 32 | - uses: actions/checkout@v6 |
| 33 | - uses: actions/setup-java@v6 |
| 34 | with: |
| 35 | distribution: temurin |
| 36 | java-version: 21 |
| 37 | - uses: dtolnay/rust-toolchain@stable |
| 38 | with: |
| 39 | targets: aarch64-linux-android, x86_64-linux-android |
| 40 | - run: cargo install cargo-ndk --locked |
| 41 | - name: Android SDK packages |
| 42 | run: yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --install "ndk;30.0.16248370" "platforms;android-37.0" "build-tools;36.0.0" > /dev/null |
| 43 | - run: ./gradlew --no-daemon assembleDebug testDebugUnitTest |
| 44 | working-directory: android |