Add CI workflow for building and testing the app #3
Workflow file for this run
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@v4 | |
with: | |
submodules: true | |
- name: Validate gradle wrapper checksum | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
cache: gradle | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
- name: Install gomobile | |
run: go install golang.org/x/mobile/cmd/gomobile@latest | |
- name: Get NDK version | |
id: get_version | |
shell: bash | |
run: | | |
sed -nr 's/^\s*(ndkVersion)\s*(=)\s"(.+)".*$/\1\2\3/p' \ | |
app/build.gradle.kts \ | |
>> "${GITHUB_OUTPUT}" | |
- name: Build and test | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 34 | |
arch: x86_64 | |
ndk: ${{ steps.get_version.outputs.ndkVersion }} | |
# Debug build only since release builds require a signing key | |
script: ./gradlew --no-daemon build -x assembleRelease |