Skip to content

Commit

Permalink
Add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jocoand committed Dec 26, 2024
1 parent 1e39b71 commit a384690
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/store-screenshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: store screenshots

on:
workflow_dispatch

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx6g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
test:
runs-on: macos-latest

permissions:
contents: read
actions: write

steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 19

- name: Gradle cache
uses: gradle/gradle-build-action@v2

- name: test
run: |
# Create screenshots
./gradlew app:recordRoborazziDebug --stacktrace
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot
path: app/build/outputs/roborazzi
retention-days: 30

- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-reports
path: app/build/reports
retention-days: 30

- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-test-results
path: app/build/test-results
retention-days: 30
58 changes: 58 additions & 0 deletions .github/workflows/verify-screenshot-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: screenshot test

on:
push

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx6g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
test:
runs-on: macos-latest

permissions:
contents: read
actions: write

steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 19

- name: Gradle cache
uses: gradle/gradle-build-action@v2

- uses: dawidd6/action-download-artifact@v3
with:
name: screenshot
path: app/build/outputs/roborazzi
workflow: store-screenshots.yml
branch: main

- name: verify test
id: verify-test
run: |
./gradlew app:verifyRoborazziDebug --stacktrace
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-diff
path: app/build/outputs/roborazzi
retention-days: 30

- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-diff-reports
path: app/build/reports
retention-days: 30

- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshot-diff-test-results
path: app/build/test-results
retention-days: 30

0 comments on commit a384690

Please sign in to comment.