Skip to content

Test PR for visual regression testing #1

Test PR for visual regression testing

Test PR for visual regression testing #1

Workflow file for this run

name: Visual Regression Test
on:
pull_request:
env:
CI: true
jobs:
test:
name: Run visual regression test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: marshallku/actions/setup-pnpm@master
- name: Install puppeteer
run: npx puppeteer browsers install chrome
- name: Run backstop server in background
run: pnpm dev --filter @marshallku/visual-regression &
- name: Generate reference files
run: |
git checkout ${{ github.base_ref }}
pnpm build --filter !@marshallku/blog
cd apps/visual-regression
pnpm backstop:reference
cd ../..
- name: Checkout to PR branch
run: git checkout ${{ github.head_ref }}
- uses: marshallku/actions/setup-pnpm@master
- name: Build apps and packages without blog
run: pnpm build --filter !@marshallku/blog
- name: Run test
id: test
continue-on-error: true
run: pnpm test:visual-regression
- name: Check test result
if: ${{ !cancelled() }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Test result - ${{ steps.test.outcome }}
You can check results [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
- name: Upload test results
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: backstop-data
path: apps/visual-regression/backstop_data
retention-days: 30