Skip to content

run screenshot test on GARM #11

run screenshot test on GARM

run screenshot test on GARM #11

Workflow file for this run

name: "End to end test"
on:
pull_request:
branches: [ master, stable-* ]
permissions:
contents: read
pull-requests: write
jobs:
tests:
runs-on: ubuntu-22.04 # our own GARM does not yet support it
services:
server:
image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest
ports:
- 80:80
strategy:
fail-fast: false
matrix:
scheme: [ Light ]
color: [ blue ]
api-level: [ 27 ]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ping server
run: |
ping -c5 http://localhost:80
curl http://localhost/status.php
- name: Enable KVM group perms
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: Gradle cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: AVD cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: "temurin"
java-version: 17
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
arch: x86
sdcard-path-or-size: 100M
target: google_apis
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
script: echo "Generated AVD snapshot for caching."
- name: Configure gradle daemon
run: |
mkdir -p $HOME/.gradle
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
- name: Build gplay
run: ./gradlew assembleGplayDebug
- name: Delete old comments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ always() }}
run: scripts/deleteOldComments.sh "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}}
- name: Run screenshot tests
env:
SHOT_TEST: "true"
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
arch: x86
sdcard-path-or-size: 100M
target: google_apis
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
script: scripts/wait_for_emulator.sh && ./gradlew createGplayDebugCoverageReport -Pcoverage
- name: upload failing results
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}}
- name: Archive Espresso results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: ${{ always() }}
with:
name: Report-${{ matrix.color }}-${{ matrix.scheme }}
path: app/build/reports
retention-days: 4