Skip to content

Commit

Permalink
Better regression update flow
Browse files Browse the repository at this point in the history
  • Loading branch information
brachkow committed Sep 25, 2024
1 parent 7314b21 commit 1890ebb
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 68 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push]

jobs:
regression:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Checkout 🛎
Expand All @@ -22,16 +22,24 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Install playwright browsers 😈
run: npx playwright install
- name: Install playwright browsers
run: pnpm playwright install

- name: Run visual tests 📸
run: pnpm run test:visual
- name: Run visual regression tests
run: pnpm run test:regression

- name: Saving test results 📥
- name: Saving diffs 📥
if: failure()
uses: actions/upload-artifact@v4
with:
name: diff
path: src/__image_snapshots__/__diff_output__
path: tests/__image_snapshots__/__diff_output__
retention-days: 14

- name: Saving failure 📥
if: failure()
uses: actions/upload-artifact@v4
with:
name: received
path: tests/__image_snapshots__/__received_output__
retention-days: 14
36 changes: 36 additions & 0 deletions .github/workflows/update-regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update regression tests snapshots
on: workflow_dispatch

jobs:
regression:
runs-on: ubuntu-20.04

steps:
- name: Checkout 🛎
uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: 9

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Install playwright browsers
run: pnpm playwright install

- name: Run regression tests
run: pnpm run test:regression:update

- name: Saving screenshots 📥
uses: actions/upload-artifact@v4
with:
name: updated-screenshots
path: tests/__image_snapshots__/
retention-days: 14
61 changes: 0 additions & 61 deletions .github/workflows/write-regression.yml

This file was deleted.

0 comments on commit 1890ebb

Please sign in to comment.