This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
Initial commit #2
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
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build-app: | |
name: Build app | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
submodules: true | |
- name: Validate gradle wrapper checksum | |
uses: gradle/actions/wrapper-validation@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
cache: gradle | |
- name: Install cargo-android | |
shell: bash | |
run: | | |
cargo install \ | |
--git https://github.com/chenxiaolong/cargo-android \ | |
--tag v0.1.3 | |
- name: Install toolchains | |
shell: bash | |
run: | | |
rustup target add aarch64-linux-android | |
rustup target add x86_64-linux-android | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 | |
# We currently use the old eagerly evaluated android.ndkDirectory value in | |
# app/build.gradle.kts instead of the new lazily evaluated | |
# androidComponents.sdkComponents.ndkDirectory because the latter doesn't | |
# actually work (provider contains no value). However, because of this, | |
# AGP's automatic NDK installation breaks, so we need to manually install | |
# it here. | |
- name: Install Android NDK | |
shell: bash | |
run: | | |
set +o pipefail | |
version=$(sed -nr -e 's/^\s*ndkVersion\s*=\s"(.+)".*$/\1/p' app/build.gradle.kts) | |
yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "ndk;${version}" | |
- name: Build and test | |
# Debug build only since release builds require a signing key | |
run: ./gradlew --no-daemon build zipDebug -x assembleRelease |