From aabb5d5d04b728cb90d83c1d5c6d302632accd6a Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 22 Feb 2024 20:08:26 +0100 Subject: [PATCH 1/3] Rename unit test workflow --- .github/workflows/{test.yml => unit-test.yml} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{test.yml => unit-test.yml} (82%) diff --git a/.github/workflows/test.yml b/.github/workflows/unit-test.yml similarity index 82% rename from .github/workflows/test.yml rename to .github/workflows/unit-test.yml index 3d189ed25f..603757aa3d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/unit-test.yml @@ -1,4 +1,4 @@ -name: Test with Gradle +name: Gradle unit tests on: push: @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - test: + unit-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -20,5 +20,5 @@ jobs: - uses: gradle/actions/setup-gradle@v3 - - name: Test with Gradle + - name: Run unit tests with Gradle run: ./gradlew test From fa97144e7e08ec6830096f6ed683c3aac27d58c4 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 22 Feb 2024 20:10:27 +0100 Subject: [PATCH 2/3] Add Android tests workflow --- .github/workflows/android-test.yml | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/android-test.yml diff --git a/.github/workflows/android-test.yml b/.github/workflows/android-test.yml new file mode 100644 index 0000000000..82b74140e7 --- /dev/null +++ b/.github/workflows/android-test.yml @@ -0,0 +1,63 @@ +name: Gradle Android tests + +on: + push: + branches: + - "master" + workflow_dispatch: + +jobs: + android-test: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - api-level: 34 + jdk-version: 21 + arch: x86_64 + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.jdk-version }} + uses: actions/setup-java@v4 + with: + java-version: '${{ matrix.jdk-version }}' + distribution: 'temurin' + + - uses: gradle/actions/setup-gradle@v3 + + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: AVD cache + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.jdk-version }}-${{ 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: ${{ matrix.arch }} + 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 Android instrumentation tests + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + arch: ${{ matrix.arch }} + 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: ./gradlew :app:connectedDebugAndroidTest From 9996c51b375b3a1ba5e722b4a063ec478db1e7a1 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Sun, 5 Jan 2025 18:44:39 +0100 Subject: [PATCH 3/3] Also run tests on this branch (revert before merging) --- .github/workflows/android-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/android-test.yml b/.github/workflows/android-test.yml index 82b74140e7..5e4943f036 100644 --- a/.github/workflows/android-test.yml +++ b/.github/workflows/android-test.yml @@ -4,6 +4,7 @@ on: push: branches: - "master" + - "actions-instrumentation-tests" workflow_dispatch: jobs: