-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add update-visual-tests manual job
- Loading branch information
Showing
1 changed file
with
51 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,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 |