Files
webstudio/.github/workflows/vis-reg-tests.yml

50 lines
1.4 KiB
YAML

name: Visual Regression Tests
on:
push:
branches:
- main
pull_request:
pull_request_target:
types: [labeled]
# cancel in-progress runs on new commits to same PR (gitub.event.number)
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
lost-pixel:
# Run on push, regular PR (for repo branches), or labeled PR with safe-to-deploy (for forks)
# Release branches are assembled from already-reviewed changes, and visual
# diffs should not block publishing the release branch itself.
if: |
(
github.event_name == 'push' ||
github.event_name == 'pull_request' ||
(github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-deploy')
) &&
!startsWith(github.head_ref || github.ref_name, 'release-')
timeout-minutes: 20
runs-on: ubuntu-latest
env:
DATABASE_URL: postgres://
AUTH_SECRET: test
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
- uses: ./.github/actions/ci-setup
- run: VISUAL_TESTING=true pnpm storybook:build
- name: Lost Pixel
uses: lost-pixel/lost-pixel@v3.16.0
env:
LOST_PIXEL_API_KEY: 8b76db6c-b9f0-46d1-982f-70900a02690a