Create AVD and generate snapshot for caching. Also force AVD creation when no cache hit
This commit is contained in:
parent
0e45494c11
commit
0c28384ece
|
@ -14,6 +14,9 @@ jobs:
|
||||||
tests:
|
tests:
|
||||||
name: Runs all tests
|
name: Runs all tests
|
||||||
runs-on: buildjet-4vcpu-ubuntu-2204
|
runs-on: buildjet-4vcpu-ubuntu-2204
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
api-level: [28]
|
||||||
# Allow all jobs on main and develop. Just one per PR.
|
# Allow all jobs on main and develop. Just one per PR.
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('unit-tests-{0}', github.ref) }}
|
group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('unit-tests-{0}', github.ref) }}
|
||||||
|
@ -36,18 +39,39 @@ jobs:
|
||||||
httpPort: 8080
|
httpPort: 8080
|
||||||
disableRateLimiting: true
|
disableRateLimiting: true
|
||||||
public_baseurl: "http://10.0.2.2:8080/"
|
public_baseurl: "http://10.0.2.2:8080/"
|
||||||
|
|
||||||
|
- 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 }}
|
||||||
|
arch: x86
|
||||||
|
profile: Nexus 5X
|
||||||
|
force-avd-creation: true # Is set to false in the doc https://github.com/ReactiveCircus/android-emulator-runner
|
||||||
|
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||||
|
disable-animations: true
|
||||||
|
script: echo "Generated AVD snapshot for caching."
|
||||||
|
|
||||||
- name: Run all the codecoverage tests at once
|
- name: Run all the codecoverage tests at once
|
||||||
id: tests
|
|
||||||
uses: reactivecircus/android-emulator-runner@v2
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
# continue-on-error: true
|
# continue-on-error: true
|
||||||
with:
|
with:
|
||||||
api-level: 28
|
api-level: ${{ matrix.api-level }}
|
||||||
arch: x86
|
arch: x86
|
||||||
profile: Nexus 5X
|
profile: Nexus 5X
|
||||||
force-avd-creation: false
|
force-avd-creation: false
|
||||||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||||
disable-animations: true
|
disable-animations: true
|
||||||
emulator-build: 7425822
|
# emulator-build: 7425822
|
||||||
script: |
|
script: |
|
||||||
./gradlew gatherGplayDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES
|
./gradlew gatherGplayDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES
|
||||||
./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
|
./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
|
||||||
|
|
Loading…
Reference in New Issue