From ea2df128b1aa9e134e078c6521f9f769a0d3baaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A1s?= Date: Mon, 23 Oct 2023 11:58:32 +0200 Subject: [PATCH] Improve build --- .github/workflows/main.yml | 31 ++++++++++++++++++++++++++++--- .github/workflows/publish.yml | 3 ++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af964437..fe13a024 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + + - name: Gradle cache + uses: gradle/gradle-build-action@v2 - name: Copy CI gradle.properties run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties @@ -47,11 +50,33 @@ jobs: with: java-version: 11 + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} + + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + 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: Run instrumentation tests - uses: ReactiveCircus/android-emulator-runner@v2.28.0 + uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true arch: x86_64 profile: pixel_xl - disable-animations: true + script: ./gradlew :sample:connectedCheck :barista-compose:connectedCheck diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 887b41c1..c5b4e0b7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Set up JDK 11 uses: actions/setup-java@v1 with: