Bump Espresso screenshot tests #831
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PullRequest | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
buildTest: | |
name: Espresso | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macOS-13 ] | |
api: [ 28 ] | |
tag: [ default ] | |
abi: [ x86_64 ] | |
java_version: [ 17 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: prepare | |
run: brew install exiftool imagemagick | |
- name: Install JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: ${{ matrix.java_version }} | |
- name: Install Android SDK | |
uses: hannesa2/action-android/[email protected] | |
- name: Build project | |
run: ./gradlew assembleDebug | |
- name: Run tests | |
run: ./gradlew test | |
- name: Run instrumentation tests | |
uses: hannesa2/action-android/[email protected] | |
with: | |
cmd: ./gradlew :app:cAT | |
api: ${{ matrix.api }} | |
tag: ${{ matrix.tag }} | |
abi: ${{ matrix.abi }} | |
cmdOptions: -noaudio -no-boot-anim -no-window -metrics-to-console | |
bootTimeout: 720 | |
disableAnimations: true | |
- name: Archive Espresso results | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: Touch-Espresso-report | |
path: app/build/reports/androidTests/connected | |
if-no-files-found: error | |
- name: Archive screenshots | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Touch-Screenshots | |
path: | | |
app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected | |
app/build/outputs/androidTest-results/connected | |
- name: Compare screenshots | |
run: | | |
ls -ls app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected | |
cp app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/emulator\(AVD\)\ -\ 9/* screenshotsToCompare | |
./screenShotCompare.sh | |
- name: Archive screenshots diffs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Touch-Screenshots-diffs | |
path: | | |
screenshotDiffs | |
- name: Show git status | |
if: ${{ always() }} | |
run: | | |
git add screenshotsToCompare | |
git status | |
[ "$(git status -s -uno)" ] && exit 1 || exit 0 | |
Check: | |
name: Check | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
java_version: [ 17 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Install JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: ${{ matrix.java_version }} | |
- uses: gradle/actions/wrapper-validation@v4 | |
- name: Install Android SDK | |
uses: hannesa2/action-android/[email protected] | |
- name: Code checks | |
run: ./gradlew check | |
- name: Archive Lint report | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: TouchImage-Lint-report | |
path: app/build/reports/lint-results*.html |