Add visual test updater job + fix visual tests #5
Workflow file for this run
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
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 |