Skip to content

Commit

Permalink
Use configuration from nowinandroid
Browse files Browse the repository at this point in the history
  • Loading branch information
hb0 committed Mar 20, 2024
1 parent 958cc69 commit be2d00a
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/gradle_connected-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
sudo udevadm trigger --name-match=kvm
ls /dev/kvm
- name: Checkout commit
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
Expand All @@ -78,8 +78,9 @@ jobs:
# run: ./gradlew build

# Add caching to speed up connected tests below (see `actions/android-emulator-runner`)
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: AVD cache
uses: actions/cache@v3
id: avd-cache
Expand All @@ -97,15 +98,34 @@ jobs:
disable-animations: true
script: echo "Generated AVD snapshot for caching."

# From https://github.com/android/nowinandroid/blob/main/.github/workflows/Build.yaml#L142
- name: Build projects before running emulator
run: ./gradlew packageDebugAndroidTest

# Only execute mock tests to exclude `@FlakyTest`s (instead of running `connectedCheck`)
- name: Connected tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save
avd-name: macOS-avd-28
# From https://github.com/android/nowinandroid >>>
arch: x86_64
disable-animations: true
script: ./gradlew :persistence:connectedDebugAndroidTest :datacapturing:connectedDebugAndroidTest :synchronization:connectedDebugAndroidTest
disk-size: 6000M
heap-size: 600M
# <<<<
# default options are: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
# Action recommendation: -no-snapshot-save -camera-back none
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
#avd-name: ubuntu-avd-28
#force-avd-creation: false
script: ./gradlew :persistence:connectedDebugAndroidTest :datacapturing:connectedDebugAndroidTest :synchronization:connectedDebugAndroidTest --daemon
# To execute a single test class
#script: ./gradlew :datacapturing:connectedCyfaceMockDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=de.cyface.datacapturing.DataCapturingServiceTest
#script: ./gradlew :datacapturing:connectedCyfaceMockDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=de.cyface.datacapturing.DataCapturingServiceTest --daemon

# From https://github.com/android/nowinandroid/blob/main/.github/workflows/Build.yaml#L142
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.api-level }}
path: '**/build/reports/androidTests'

0 comments on commit be2d00a

Please sign in to comment.