Skip to content

Update android.yml action versions #266

Update android.yml action versions

Update android.yml action versions #266

Workflow file for this run

name: Android CI
on:
push:
branches: [ "main" ]
paths-ignore:
- '**.md'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**.md'
concurrency:
group: android-ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
checks: write
id-token: write
env:
JAVA_VERSION: "17"
JAVA_DISTR: 'zulu'
jobs:
tests_and_apk:
name: "🤖 Local Tests and 📦 APKs"
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTR }}
java-version: ${{ env.JAVA_VERSION }}
- name: Create google-services.json file
run: cat /home/runner/work/newquiz/newquiz/app/google-services.json | base64
- name: Put google-services.json data
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/newquiz/newquiz/app/google-services.json
- name: Workaround for Android Gradle Plugin issue
run: 'echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" > local.properties'
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
- name: Run unit tests
run: ./gradlew testAllUnitTest --stacktrace
- name: Publish Test Report
uses: mikepenz/action-junit-report@4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test*/TEST-*.xml'
- name: Lint sources
run: ./gradlew lint --stacktrace
- name: Generate GitHub annotations
uses: yutailang0119/action-android-lint@v4
with:
report-path: '**/build/reports/*.xml'
- name: Run Detekt
run: ./gradlew detekt --stacktrace
- name: Assemble debug APKs
run: ./gradlew assembleNormalDebug assembleFossDebug --stacktrace
- name: Upload APKs
uses: actions/upload-artifact@v4
with:
name: APKs
path: app/build/outputs/apk/**/app-*-universal-debug.apk