-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Create workflow to update screenshots
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Update Visual Regression Snapshots | ||
|
||
on: | ||
pull_request: | ||
types: [labeled, synchronize] | ||
|
||
jobs: | ||
update-snapshots: | ||
if: github.event.pull_request.state != 'closed' && (github.event.label.name == 'deploy-preview' || contains( github.event.pull_request.labels.*.name, 'deploy-preview')) | ||
runs-on: ubuntu-latest | ||
container: | ||
image: mcr.microsoft.com/playwright:v1.41.0 | ||
options: --user 1001:1000 | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Setup NPM cache | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
cache: "npm" | ||
- name: Install node dependencies | ||
run: npm ci | ||
- name: Build frontend | ||
run: npm run build | ||
- name: Build mock website | ||
run: npm run build:e2e | ||
- name: Start server | ||
run: npm run start:visual-preview | ||
- name: Run Playwright tests | ||
run: npm run test:visual -- --update-snapshots | ||
- name: Overwrite Playwright snapshots | ||
run: | | ||
git config user.name '${{ secrets.BPMN_IO_USERNAME }}' | ||
git config user.email '${{ secrets.BPMN_IO_EMAIL }}' | ||
git add -A | ||
git commit -m "chore(CI): updated snapshots" || echo "No changes to commit" | ||
git push |