Add visual test updater job + fix visual tests #7
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: 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: | | |
/usr/bin/git config user.name "kiwicom-orbit-bot" | |
/usr/bin/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 | |
/usr/bin/git add --all | |
if /usr/bin/git diff-index --quiet HEAD; then | |
echo "No changes to visual tests" | |
exit 0 | |
else | |
echo "Commiting changes to visual tests" | |
/usr/bin/git commit -m "${{ github.event.inputs.commitMessage || 'chore: update visual tests' }}" | |
/usr/bin/git push origin HEAD | |
fi |