114 lines
2.8 KiB
YAML
114 lines
2.8 KiB
YAML
name: Android CI Build
|
|
|
|
on:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: android-ci-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
|
|
steps:
|
|
- name: Download code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Prepare Java
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: "17"
|
|
|
|
- name: Prepare Android tools
|
|
uses: android-actions/setup-android@v3
|
|
with:
|
|
packages: ""
|
|
|
|
- name: Prepare Gradle
|
|
uses: gradle/actions/setup-gradle@v6
|
|
with:
|
|
cache-provider: basic
|
|
|
|
- name: Install needed tools
|
|
run: |
|
|
sdkmanager --install \
|
|
"platform-tools" \
|
|
"platforms;android-36" \
|
|
"build-tools;36.0.0" \
|
|
"cmake;3.22.1" \
|
|
"ndk;28.2.13676358"
|
|
|
|
- name: Run checks
|
|
run: |
|
|
./gradlew --no-daemon --no-configuration-cache \
|
|
-Dkotlin.compiler.execution.strategy=in-process \
|
|
-PskipShellTemplateSync=true \
|
|
-PallowDebugSignedRelease=true \
|
|
:app:compileDebugKotlin \
|
|
:shell:compileDebugKotlin \
|
|
:app:testDebugUnitTest
|
|
|
|
package-apks:
|
|
if: github.event_name == 'workflow_dispatch'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 90
|
|
|
|
steps:
|
|
- name: Download code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Prepare Java
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: "17"
|
|
|
|
- name: Prepare Android tools
|
|
uses: android-actions/setup-android@v3
|
|
with:
|
|
packages: ""
|
|
|
|
- name: Prepare Gradle
|
|
uses: gradle/actions/setup-gradle@v6
|
|
with:
|
|
cache-provider: basic
|
|
|
|
- name: Install needed tools
|
|
run: |
|
|
sdkmanager --install \
|
|
"platform-tools" \
|
|
"platforms;android-36" \
|
|
"build-tools;36.0.0" \
|
|
"cmake;3.22.1" \
|
|
"ndk;28.2.13676358"
|
|
|
|
- name: Build APKs
|
|
run: |
|
|
./gradlew --no-daemon --no-configuration-cache \
|
|
-Dkotlin.compiler.execution.strategy=in-process \
|
|
-PallowDebugSignedRelease=true \
|
|
:app:assembleDebug \
|
|
:app:assembleRelease \
|
|
:shell:assembleDebug \
|
|
:shell:assembleRelease
|
|
|
|
- name: Upload APK artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: android-apks-DEBUG-SIGNED-do-not-distribute-${{ github.run_number }}
|
|
path: |
|
|
app/build/outputs/apk/**/*.apk
|
|
shell/build/outputs/apk/**/*.apk
|
|
if-no-files-found: error
|
|
retention-days: 14
|