From cbafad99a0f01de9dae4f13fe9496c7123d48fe9 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Tue, 23 Feb 2021 17:28:11 +0100 Subject: [PATCH 1/2] Harmonize screenshot test with a matrix Signed-off-by: Hannes Achleitner --- .github/workflows/blueLight.yml | 40 ------------------- .../{blueDark.yml => screenShotTest.yml} | 14 ++++--- .github/workflows/whiteDark.yml | 40 ------------------- .github/workflows/whiteLight.yml | 40 ------------------- 4 files changed, 9 insertions(+), 125 deletions(-) delete mode 100644 .github/workflows/blueLight.yml rename .github/workflows/{blueDark.yml => screenShotTest.yml} (74%) delete mode 100644 .github/workflows/whiteDark.yml delete mode 100644 .github/workflows/whiteLight.yml diff --git a/.github/workflows/blueLight.yml b/.github/workflows/blueLight.yml deleted file mode 100644 index b29d547b43..0000000000 --- a/.github/workflows/blueLight.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: "Blue color on light mode" - -on: - pull_request: - branches: [ master, stable-* ] - -jobs: - blueLight: - runs-on: macOS-latest - steps: - - uses: actions/checkout@v2 - - name: set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build gplay - run: | - mkdir -p $HOME/.gradle - echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties - ./gradlew assembleGplayDebug - - name: Delete old comments - env: - GIT_USERNAME: ${{ secrets.GIT_USERNAME }} - GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - run: scripts/deleteOldComments.sh "Blue-Light" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" - - name: run tests - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 27 - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 - script: ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest -Pandroid.testInstrumentationRunnerArguments.COLOR=blue -Pandroid.testInstrumentationRunnerArguments.DARKMODE=light - - name: upload failing results - if: ${{ failure() }} - env: - LOG_USERNAME: ${{ secrets.LOG_USERNAME }} - LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }} - GIT_USERNAME: ${{ secrets.GIT_USERNAME }} - GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - run: - scripts/uploadReport.sh "$LOG_USERNAME" "$LOG_PASSWORD" ${{github.event.number}} "Blue-Light" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" diff --git a/.github/workflows/blueDark.yml b/.github/workflows/screenShotTest.yml similarity index 74% rename from .github/workflows/blueDark.yml rename to .github/workflows/screenShotTest.yml index bee3f772d6..36f55a97d4 100644 --- a/.github/workflows/blueDark.yml +++ b/.github/workflows/screenShotTest.yml @@ -1,12 +1,16 @@ -name: "Blue color on dark mode" +name: "Screenshot Test" on: pull_request: branches: [ master, stable-* ] jobs: - blueDark: + screenshot: runs-on: macOS-latest + strategy: + matrix: + scheme: [ Dark, Light ] + color: [ blue, white ] steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 @@ -22,13 +26,13 @@ jobs: env: GIT_USERNAME: ${{ secrets.GIT_USERNAME }} GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - run: scripts/deleteOldComments.sh "Blue-Dark" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" + run: scripts/deleteOldComments.sh "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" - name: run tests uses: reactivecircus/android-emulator-runner@v2 with: api-level: 27 emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 - script: ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest -Pandroid.testInstrumentationRunnerArguments.COLOR=blue -Pandroid.testInstrumentationRunnerArguments.DARKMODE=dark + script: ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest -Pandroid.testInstrumentationRunnerArguments.COLOR=${{ matrix.color }} -Pandroid.testInstrumentationRunnerArguments.DARKMODE=${{ matrix.scheme }} - name: upload failing results if: ${{ failure() }} env: @@ -37,4 +41,4 @@ jobs: GIT_USERNAME: ${{ secrets.GIT_USERNAME }} GIT_TOKEN: ${{ secrets.GIT_TOKEN }} run: - scripts/uploadReport.sh "$LOG_USERNAME" "$LOG_PASSWORD" ${{github.event.number}} "Blue-Dark" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" + scripts/uploadReport.sh "$LOG_USERNAME" "$LOG_PASSWORD" ${{github.event.number}} "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" diff --git a/.github/workflows/whiteDark.yml b/.github/workflows/whiteDark.yml deleted file mode 100644 index 20dc3df3a6..0000000000 --- a/.github/workflows/whiteDark.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: "White color on dark mode" - -on: - pull_request: - branches: [ master, stable-* ] - -jobs: - whiteDark: - runs-on: macOS-latest - steps: - - uses: actions/checkout@v2 - - name: set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build gplay - run: | - mkdir -p $HOME/.gradle - echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties - ./gradlew assembleGplayDebug - - name: Delete old comments - env: - GIT_USERNAME: ${{ secrets.GIT_USERNAME }} - GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - run: scripts/deleteOldComments.sh "White-Dark" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" - - name: run tests - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 27 - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 - script: ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest -Pandroid.testInstrumentationRunnerArguments.COLOR=white -Pandroid.testInstrumentationRunnerArguments.DARKMODE=dark - - name: upload failing results - if: ${{ failure() }} - env: - LOG_USERNAME: ${{ secrets.LOG_USERNAME }} - LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }} - GIT_USERNAME: ${{ secrets.GIT_USERNAME }} - GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - run: - scripts/uploadReport.sh "$LOG_USERNAME" "$LOG_PASSWORD" ${{github.event.number}} "White-Dark" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" diff --git a/.github/workflows/whiteLight.yml b/.github/workflows/whiteLight.yml deleted file mode 100644 index 2026bb6bfe..0000000000 --- a/.github/workflows/whiteLight.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: "White color on light mode" - -on: - pull_request: - branches: [ master, stable-* ] - -jobs: - whiteLight: - runs-on: macOS-latest - steps: - - uses: actions/checkout@v2 - - name: set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build gplay - run: | - mkdir -p $HOME/.gradle - echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties - ./gradlew assembleGplayDebug - - name: Delete old comments - env: - GIT_USERNAME: ${{ secrets.GIT_USERNAME }} - GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - run: scripts/deleteOldComments.sh "White-Light" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" - - name: run tests - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 27 - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 - script: ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest -Pandroid.testInstrumentationRunnerArguments.COLOR=white -Pandroid.testInstrumentationRunnerArguments.DARKMODE=light - - name: upload failing results - if: ${{ failure() }} - env: - LOG_USERNAME: ${{ secrets.LOG_USERNAME }} - LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }} - GIT_USERNAME: ${{ secrets.GIT_USERNAME }} - GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - run: - scripts/uploadReport.sh "$LOG_USERNAME" "$LOG_PASSWORD" ${{github.event.number}} "White-Light" "Screenshot" ${{github.event.number}} "$GIT_USERNAME" "$GIT_TOKEN" From c1eac11903d3c905c19745272975d96e93f233d9 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Tue, 23 Feb 2021 20:04:34 +0100 Subject: [PATCH 2/2] Build in matrix all Signed-off-by: Hannes Achleitner --- .github/workflows/screenShotTest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/screenShotTest.yml b/.github/workflows/screenShotTest.yml index 36f55a97d4..7cb30cf4a6 100644 --- a/.github/workflows/screenShotTest.yml +++ b/.github/workflows/screenShotTest.yml @@ -8,6 +8,7 @@ jobs: screenshot: runs-on: macOS-latest strategy: + fail-fast: false matrix: scheme: [ Dark, Light ] color: [ blue, white ]