Skip to content

Instantly share code, notes, and snippets.

@davidvavra
Created June 30, 2022 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidvavra/f5152ce95299e58fec53649f86bfb35f to your computer and use it in GitHub Desktop.
Save davidvavra/f5152ce95299e58fec53649f86bfb35f to your computer and use it in GitHub Desktop.
name: Pull request validation (main)
on:
pull_request:
branches:
- main
concurrency:
group: pr-main-${{ github.head_ref }}
cancel-in-progress: true
jobs:
screenshot-tests:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run screenshot tests
id: run-screenshot-tests
run: ./gradlew verifyPaparazziDebug
- name: Process failed screenshot tests
if: failure()
id: failed-screenshots
run: "./.github/workflows/scripts/process_failed_screenshots.sh"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
PR_BRANCH: ${{ github.head_ref }}
- name: Comment PR if screenshot tests failed
uses: octokit/request-action@v2.0.0
if: always() && steps.failed-screenshots.outputs.PR_COMMENT
with:
route: POST /repos/:repo/issues/:issue_number/comments
repo: ${{ github.repository }}
issue_number: ${{ steps.failed-screenshots.outputs.PR_NUMBER }}
body: ${{ steps.failed-screenshots.outputs.PR_COMMENT }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment