Add paparazzi tests #5
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: Run tests and publish snapshot | |
on: | |
push: | |
branches: [ trunk ] | |
pull_request: | |
jobs: | |
checks: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/[email protected] | |
- name: Run unit tests | |
run: ./gradlew check | |
- name: Run paparazzi screenshot tests | |
run: ./gradlew verifyPaparazziDebug | |
- name: (Fail-only) Upload paparazzi test reports | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-failures | |
path: | | |
**/build/reports/tests/*/ | |
**/out/failures/ | |
paparazzi/paparazzi-gradle-plugin/src/test/projects/**/build/reports/paparazzi/images/ | |
deploy-snapshot: | |
name: Deploy snapshot | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
if: github.repository == 'saket/squiggly-slider' && github.ref == 'refs/heads/trunk' | |
needs: [ checks ] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/[email protected] | |
- uses: oNaiPs/secrets-to-env-action@v1 | |
with: | |
secrets: ${{ toJSON(secrets) }} | |
- name: Ensure snapshot version | |
run: ./gradlew library:throwIfVersionIsNotSnapshot | |
- name: Publish snapshot | |
run: ./gradlew clean publish --no-daemon --no-parallel --no-configuration-cache --stacktrace | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_PASSWORD }} |