diff --git a/.github/workflows/update_snapshots.yml b/.github/workflows/update_snapshots.yml new file mode 100644 index 0000000..5113690 --- /dev/null +++ b/.github/workflows/update_snapshots.yml @@ -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 \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index cccbfe6..60a3cd7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,3 +23,5 @@ kotlin.code.style=official android.nonTransitiveRClass=true android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false + +roborazzi.contextdata=false \ No newline at end of file