Merge pull request #526 from takahirom/renovate/androidx.compose.ui.t… #1558
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: diff test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx6g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" | |
jobs: | |
test: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
- uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 | |
with: | |
distribution: 'zulu' | |
java-version: 19 | |
- name: Gradle cache | |
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2 | |
- uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2 | |
with: | |
name: screenshot | |
path: sample-android/build/outputs/roborazzi | |
workflow: StoreScreenshot.yml | |
branch: main | |
- name: compare test | |
run: | | |
echo '<resources> | |
<string name="first_fragment_label">Hello! This is compare test screen! Compare me!</string> | |
<string name="hello_first_fragment">Compare Hello first fragment</string> | |
</resources>' > sample-android/src/main/res/values/strings_for_test.xml | |
./gradlew sample-android:compareRoborazziDebug --stacktrace | |
# Check if there are difference with sample-android/build/outputs/roborazzi/test_compare.png | |
find sample-android/build/outputs/roborazzi | |
file_path="sample-android/build/outputs/roborazzi/com.github.takahirom.roborazzi.sample.ManualTest.captureScreenLevelImageWithEspresso_compare.png" | |
if [ ! -f "$file_path" ]; then | |
echo "Error: File $file_path not found." | |
exit 1 | |
else | |
echo "File $file_path found." | |
exit 0 | |
fi | |
- name: verify test | |
id: verify-test | |
continue-on-error: true | |
run: | | |
echo '<resources> | |
<string name="first_fragment_label">Hello! This is verify test screen! Verify me!</string> | |
<string name="hello_first_fragment">Verify Hello first fragment</string> | |
</resources>' > sample-android/src/main/res/values/strings_for_test.xml | |
./gradlew sample-android:verifyRoborazziDebug --stacktrace | |
- name: Run shell script on Gradle failure | |
if: steps.verify-test.outcome == 'success' | |
run: | | |
echo "Roborazzi should verify changes" | |
exit 1 | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | |
if: ${{ always() }} | |
with: | |
name: screenshot-diff | |
path: sample-android/build/outputs/roborazzi | |
retention-days: 30 | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | |
if: ${{ always() }} | |
with: | |
name: screenshot-diff-reports | |
path: sample-android/build/reports | |
retention-days: 30 | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | |
if: ${{ always() }} | |
with: | |
name: screenshot-diff-test-results | |
path: sample-android/build/test-results | |
retention-days: 30 |