diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 3c61e7a7..ed566772 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -8,22 +8,25 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - - name: set up JDK 17 - uses: actions/setup-java@v1 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 with: + distribution: 'temurin' java-version: 17 - - uses: actions/cache@v1 + + - name: Cache Gradle dependencies + uses: actions/cache@v2 with: - path: ~/.gradle/caches - # Key inspired from here - - # https://medium.com/@ychescale9/running-android-instrumented-tests-on-ci-from-bitrise-io-to-github-actions-a611e57ce71f - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} - restore-keys: ${{ runner.os }}-gradle- + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: ${{ runner.os }}-gradle + - name: Run Checks run: ./gradlew check --stacktrace @@ -31,19 +34,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: set up JDK 17 - uses: actions/setup-java@v1 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 with: + distribution: 'temurin' java-version: 17 - - name: Checkout Branch - uses: actions/checkout@v2 - - uses: actions/cache@v1 + + - name: Cache Gradle dependencies + uses: actions/cache@v2 with: - path: ~/.gradle/caches - # Key inspired from here - - # https://medium.com/@ychescale9/running-android-instrumented-tests-on-ci-from-bitrise-io-to-github-actions-a611e57ce71f - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} - restore-keys: ${{ runner.os }}-gradle- + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: ${{ runner.os }}-gradle - name: Run Paparazzi Screenshot Tests run: ./gradlew :showkase-screenshot-testing-paparazzi-sample:verifyPaparazziDebug -PuseKsp=true --stacktrace @@ -55,6 +60,7 @@ jobs: name: reports path: showkase-screenshot-testing-paparazzi-sample/build/reports/tests/testDebugUnitTest/ retention-days: 1 + - name: Upload Screenshot Failure Differences uses: actions/upload-artifact@v3 if: failure() @@ -69,48 +75,42 @@ jobs: matrix: api-level: [ 26, 29 ] target: [ default, google_apis ] + include: + - api-level: 26 + target: default + - api-level: 29 + target: google_apis steps: - uses: actions/checkout@v2 - - name: set up JDK 17 - uses: actions/setup-java@v1 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 with: + distribution: 'temurin' java-version: 17 - - name: Checkout Branch - uses: actions/checkout@v2 - - uses: actions/cache@v1 + + - name: Cache Gradle dependencies + uses: actions/cache@v2 with: - path: ~/.gradle/caches - # Key inspired from here - - # https://medium.com/@ychescale9/running-android-instrumented-tests-on-ci-from-bitrise-io-to-github-actions-a611e57ce71f - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} - restore-keys: ${{ runner.os }}-gradle- + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: ${{ runner.os }}-gradle - - name: Run UI Tests w/ KAPT + - name: Start emulator uses: reactivecircus/android-emulator-runner@v2 with: - emulator-build: 7425822 api-level: ${{ matrix.api-level }} target: ${{ matrix.target }} arch: x86_64 - script: ./gradlew connectedCheck --no-daemon --stacktrace --debug + script: ./gradlew connectedCheck --no-daemon --stacktrace -PuseKsp=true - name: Run UI Tests w/ KSP - uses: reactivecircus/android-emulator-runner@v2 - with: - emulator-build: 7425822 - api-level: ${{ matrix.api-level }} - target: ${{ matrix.target }} - arch: x86_64 - script: ./gradlew connectedCheck --no-daemon --stacktrace -PuseKsp=true --debug + run: ./gradlew connectedCheck --no-daemon --stacktrace -PuseKsp=true --continue - name: Run Screenshot Tests - uses: reactivecircus/android-emulator-runner@v2 - with: - emulator-build: 7425822 - api-level: ${{ matrix.api-level }} - target: ${{ matrix.target }} - arch: x86_64 - script: ./gradlew executeScreenshotTests -PdirectorySuffix=Api${{ matrix.api-level }} -PprintBase64 + run: ./gradlew executeScreenshotTests -PdirectorySuffix=Api${{ matrix.api-level }} -PprintBase64 - name: Upload screenshot testing report uses: actions/upload-artifact@v3 @@ -119,13 +119,12 @@ jobs: path: sample/build/reports/shot/debug/Api${{ matrix.api-level }}/verification/ retention-days: 1 -### Uncomment the jobs below if you want to generate and record screenshots. Once you download the -### artifact, place them under sample/screenshots/debug/ +# Uncomment the jobs below if you want to generate and record screenshots. Once you download the +# artifact, place them under sample/screenshots/debug/ # - name: Record screenshots # uses: reactivecircus/android-emulator-runner@v2 # with: -# emulator-build: 7425822 # api-level: ${{ matrix.api-level }} # target: ${{ matrix.target }} # arch: x86_64 @@ -137,6 +136,3 @@ jobs: # name: Api${{ matrix.api-level }} # path: sample/screenshots/debug/Api${{ matrix.api-level }} # retention-days: 1 - - -