Skip to content

Commit

Permalink
Add screenshot update task
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-paing committed Mar 28, 2024
1 parent ad6d828 commit 8435420
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/update_snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Update screenshot

on:
workflow_dispatch:

jobs:
updateScreenshot:
runs-on: macos-latest
env:
CCDROIDX_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.CCDROIDX_RELEASE_KEYSTORE_PASSWORD }}
CCDROIDX_RELEASE_KEY_ALIAS: ${{ secrets.CCDROIDX_RELEASE_KEY_ALIAS }}
CCDROIDX_RELEASE_KEY_ALIAS_PASSWORD: ${{ secrets.CCDROIDX_RELEASE_KEY_ALIAS_PASSWORD }}
CCDROIDX_RELEASE_KEYSTORE_PATH: release.keystore
GOOGLE_SERVICE_JSON: ${{ secrets.GOOGLE_SERVICE_JSON }}
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Stub release keystore file
run: |
touch release.keystore
- name: Decrypt google service json
run: |
TMP_GOOGLE_SERVICE_JSON_DIR="${RUNNER_TEMP}"/play
mkdir "${TMP_GOOGLE_SERVICE_JSON_DIR}"
echo $GOOGLE_SERVICE_JSON | base64 -D > "${TMP_GOOGLE_SERVICE_JSON_DIR}"/google-services.json
mv "${TMP_GOOGLE_SERVICE_JSON_DIR}"/google-services.json app/google-services.json
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Accept Android licenses
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true

- name: Set up Gradle
uses: gradle/gradle-build-action@v2

- name: Record Screenshot
run: ./gradlew app:verifyAndRecordRoborazziFlossDebug
continue-on-error: true

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: Updating Failing Screenshots
branch: update-screenshot
branch-suffix : short-commit-hash
title: Update Screenshot - Automated PR to update screenshot
body: Automated task to update image references for screenshot testing
labels: automated pr
reviewers: vincent-paing
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ kotlin.code.style=official
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false

roborazzi.contextdata=false

0 comments on commit 8435420

Please sign in to comment.