Skip to content

Merge pull request #397 from LachlanMcKee/agp-8.2.2 #946

Merge pull request #397 from LachlanMcKee/agp-8.2.2

Merge pull request #397 from LachlanMcKee/agp-8.2.2 #946

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Assemble
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Assemble
run: ./gradlew assemble
working-directory: .
detekt:
name: Detekt
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Detekt
run: ./gradlew detekt --stacktrace
working-directory: .
- name: Upload failure reports
if: failure()
uses: actions/upload-artifact@v4
with:
path: '**/build/reports'
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Unit tests
run: ./gradlew testDebugUnitTest
working-directory: .
- name: Upload failure reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: unit-test-reports
path: '**/build/reports'
instrumentation-tests:
name: Instrumentation tests
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Pre build sources before launching emulator
run: ./gradlew compileDebugAndroidTestSources
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-29-ribs
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
# Use API 29 https://github.com/ReactiveCircus/android-emulator-runner/issues/222
api-level: 29
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
# Use API 29 https://github.com/ReactiveCircus/android-emulator-runner/issues/222
api-level: 29
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
adb logcat > logcat.out &
./gradlew connectedCheck
- name: Upload failed instrumentation artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: instrumentation-failures
path: |
**/build/reports
logcat.out
verify-publication:
name: Verify publication
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Verify
run: ./gradlew publishToMavenLocal
working-directory: .