Skip to content

Commit

Permalink
[CI] Update target matrix, depend on build before running emulators
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Dec 19, 2023
1 parent def78c3 commit 84fb835
Showing 1 changed file with 60 additions and 34 deletions.
94 changes: 60 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ permissions:
statuses: none

jobs:
buildLibrary:
build:
if: "!contains(github.event.head_commit.message, '[SkipCI]')"
runs-on: ubuntu-22.04
steps:
Expand All @@ -72,48 +72,74 @@ jobs:
path: ~/.m2
if-no-files-found: error

runInstrumentedTests:
instrumentedTests-aosp_atd-target:
# Only macos VMs are available with exposed CPU extensions to run hardware accelerated emulator
runs-on: macos-13
name: ${{ matrix.api-level }} ${{ matrix.arch }}
name: android-${{ matrix.api-level }} on ${{ matrix.arch }} (${{ matrix.api-type-target }})
needs: build
strategy:
fail-fast: false
matrix:
api-level: [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]
arch: [x86, x86_64]
api-type-target: [default]
exclude:
- api-level: 30
arch: x86
api-type-target: default
- api-level: 31
arch: x86
api-type-target: default
- api-level: 32
arch: x86
api-type-target: default
- api-level: 33
arch: x86
api-type-target: default
- api-level: 34
arch: x86
api-type-target: default
api-level: [30, 31, 32, 33, 34]
arch: [x86_64]
api-type-target: [aosp_atd]
include:
- api-level: 30
arch: x86
api-type-target: aosp_atd
- api-level: 31
arch: x86
api-type-target: aosp_atd
- api-level: 32
arch: x86
api-type-target: aosp_atd
- api-level: 33
arch: x86
api-type-target: aosp_atd
- api-level: 34
arch: x86
api-type-target: aosp_atd
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: android-actions/setup-android@v3

- uses: reactivecircus/android-emulator-runner@v2
with:
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: ${{ matrix.api-type-target }}
sdcard-path-or-size: 1G
disk-size: 8G
script: |
mkdir -p testResults/screenshots
adb logcat > testResults/logcat.txt &
adb shell screencap /data/local/tmp/beforeTests.png
adb pull /data/local/tmp/beforeTests.png testResults/screenshots/
./gradlew connectedCheck || touch sorry_but_tests_are_failing
adb pull /sdcard/Pictures/screenshots testResults/ || true
adb shell screencap /data/local/tmp/afterTests.png
adb pull /data/local/tmp/afterTests.png testResults/screenshots/
mv pdf2htmlEX/build/reports/androidTests/connected testResults/
mv pdf2htmlEX/build/outputs/androidTest-results testResults/
test ! -f sorry_but_tests_are_failing
- uses: actions/upload-artifact@v4
if: always()
with:
name: testResults-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.api-type-target }}
path: testResults
if-no-files-found: error

instrumentedTests-default-target:
# Only macos VMs are available with exposed CPU extensions to run hardware accelerated emulator
runs-on: macos-13
name: android-${{ matrix.api-level }} on ${{ matrix.arch }} (${{ matrix.api-type-target }})
needs: build
strategy:
fail-fast: false
matrix:
api-level: [21, 22, 23, 24, 25, 26, 27, 28, 29]
arch: [x86, x86_64]
api-type-target: [default]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down

0 comments on commit 84fb835

Please sign in to comment.