Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/lukebennett88/luke-ui. ui.lukebennett.dev
Something went wrong. Try again.
YAML
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697name: Visual regression
on: pull_request: paths: - 'packages/@luke-ui/react/**' - 'packages/@luke-ui/rainbow-sprinkles/**' - 'pnpm-lock.yaml' - 'pnpm-workspace.yaml' - 'package.json' - '.github/scripts/**' - '.github/workflows/visual-regression.yml' workflow_dispatch:
concurrency: group: visual-${{ github.ref }} cancel-in-progress: true
env: TURBO_TELEMETRY_DISABLED: '1'
jobs: compare: name: compare runs-on: ubuntu-latest permissions: actions: read contents: read outputs: review: ${{ steps.summary.outputs.review }} steps: - name: Checkout repo uses: actions/checkout@v7
- name: Setup tooling uses: pnpm/setup@v3 with: cache: true install: false
- name: Install dependencies run: pnpm install --frozen-lockfile --no-runtime
- name: Resolve baseline id: baseline env: GITHUB_TOKEN: ${{ github.token }} run: pnpm --filter @luke-ui/workflow-scripts run visual-ci resolve-baseline
- name: Download baseline uses: actions/download-artifact@v8 with: name: visual-baseline path: .artifacts/visual-regression/baseline github-token: ${{ github.token }} repository: ${{ github.repository }} run-id: ${{ steps.baseline.outputs.run-id }}
- name: Fail when the baseline has no screenshots run: pnpm --filter @luke-ui/workflow-scripts run visual-ci check-captures
- name: Install Playwright Chromium run: pnpm --filter @luke-ui/react exec playwright install --with-deps chromium
- name: Build packages run: pnpm build:packages
- name: Compare against the baseline run: pnpm --filter @luke-ui/react run test:visual
- name: Summarise the comparison id: summary run: pnpm --filter @luke-ui/workflow-scripts run visual-ci summarise
- name: Upload expected, actual, and diff screenshots if: always() uses: actions/upload-artifact@v7 with: name: visual-regression-diff path: | .artifacts/visual-regression/diff .artifacts/visual-regression/summary.json if-no-files-found: ignore retention-days: 14
review: name: review if: needs.compare.outputs.review != '0' needs: compare runs-on: ubuntu-latest environment: visual-review permissions: {} steps: - name: Record the approval run: | echo "Approved ${{ needs.compare.outputs.review }} baseline change(s) for ${{ github.sha }}."