2021-02-23 19:28:11 +03:00
|
|
|
name: "Screenshot Test"
|
2020-09-25 12:53:09 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2021-01-05 16:42:56 +03:00
|
|
|
branches: [ master, stable-* ]
|
2020-09-25 12:53:09 +03:00
|
|
|
|
|
|
|
jobs:
|
2021-02-23 19:28:11 +03:00
|
|
|
screenshot:
|
2020-09-25 12:53:09 +03:00
|
|
|
runs-on: macOS-latest
|
2021-02-23 19:28:11 +03:00
|
|
|
strategy:
|
2021-02-23 22:04:34 +03:00
|
|
|
fail-fast: false
|
2021-02-23 19:28:11 +03:00
|
|
|
matrix:
|
2021-07-15 10:00:38 +03:00
|
|
|
scheme: [ Light ]
|
|
|
|
color: [ blue ]
|
2022-01-12 10:57:22 +03:00
|
|
|
api-level: [ 27 ]
|
2020-09-25 12:53:09 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-01-12 10:57:22 +03:00
|
|
|
|
|
|
|
- name: Gradle cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: AVD cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: avd-cache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.android/avd/*
|
|
|
|
~/.android/adb*
|
|
|
|
key: avd-${{ matrix.api-level }}
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v2
|
2020-09-25 12:53:09 +03:00
|
|
|
with:
|
2021-10-05 10:37:00 +03:00
|
|
|
distribution: "adopt"
|
2021-09-25 19:30:58 +03:00
|
|
|
java-version: 11
|
2022-01-12 10:57:22 +03:00
|
|
|
|
|
|
|
- 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 }}
|
|
|
|
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
|
2020-09-25 12:53:09 +03:00
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/.gradle
|
|
|
|
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
|
2022-01-12 10:57:22 +03:00
|
|
|
echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
|
|
|
|
|
|
|
|
- name: Build gplay
|
|
|
|
run: ./gradlew assembleGplayDebug
|
|
|
|
|
2021-09-10 16:33:13 +03:00
|
|
|
- name: Delete old comments
|
2021-09-21 13:04:18 +03:00
|
|
|
if: ${{ always() }}
|
2021-09-10 16:33:13 +03:00
|
|
|
run: scripts/deleteOldComments.sh "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }}
|
2022-01-12 10:57:22 +03:00
|
|
|
|
|
|
|
- name: Run screenshot tests
|
2020-09-25 12:53:09 +03:00
|
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
|
|
with:
|
2022-01-12 10:57:22 +03:00
|
|
|
api-level: ${{ matrix.api-level }}
|
|
|
|
force-avd-creation: false
|
|
|
|
arch: x86
|
|
|
|
sdcard-path-or-size: 100M
|
|
|
|
target: google_apis
|
2020-09-25 12:53:09 +03:00
|
|
|
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
|
2021-02-23 19:28:11 +03:00
|
|
|
script: ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest -Pandroid.testInstrumentationRunnerArguments.COLOR=${{ matrix.color }} -Pandroid.testInstrumentationRunnerArguments.DARKMODE=${{ matrix.scheme }}
|
2020-09-25 12:53:09 +03:00
|
|
|
- name: upload failing results
|
|
|
|
if: ${{ failure() }}
|
|
|
|
run:
|
2022-01-10 11:26:08 +03:00
|
|
|
scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }}
|
2021-02-24 15:43:14 +03:00
|
|
|
- name: Archive Espresso results
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: ${{ always() }}
|
|
|
|
with:
|
|
|
|
name: Report-${{ matrix.color }}-${{ matrix.scheme }}
|
|
|
|
path: build/reports
|
2021-02-26 12:55:11 +03:00
|
|
|
retention-days: 4
|