Skip to content

Commit

Permalink
ci: add update-visual-tests manual job
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Feb 20, 2024
1 parent c60ea4f commit db9d9f7
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/update-visual-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Update Visual Tests

on:
pull_request:
workflow_dispatch:
inputs:
commitMessage:
description: "Commit message for the update"
required: true
default: "chore: update visual tests"

jobs:
update-visual-tests:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.39.0-jammy
steps:
- name: Install git
run: sudo apt-get install git

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}

- name: Install
uses: ./.github/actions/node

- name: Setup git config
run: |
git config user.name "kiwicom-orbit-bot"
git config user.email "[email protected]"
- name: Build
run: |
yarn tokens build
yarn tailwind-preset build
yarn components build
- name: Update Visual Tests
run: |
yarn components test-ct --update-snapshots
git add --all
if git diff-index --quiet HEAD; then
echo "No changes to visual tests"
exit 0
else
echo "Commiting changes to visual tests"
git commit -m "${{ github.event.inputs.commitMessage || 'chore: update visual tests' }}"
git push origin HEAD
fi

0 comments on commit db9d9f7

Please sign in to comment.