-
Notifications
You must be signed in to change notification settings - Fork 152
51 lines (45 loc) · 1.39 KB
/
update-visual-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Update Visual Tests
on:
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.44.1-jammy
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
ref: ${{ github.head_ref }}
- name: Install
uses: ./.github/actions/node
- name: Setup git config
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config user.name "kiwicom-orbit-bot"
git config user.email "[email protected]"
- name: Build
run: |
apt-get update
apt-get install zip --yes
yarn tokens build
yarn tailwind-preset build
yarn components build
- name: Update Visual Tests
run: |
yarn components test-ct --update-snapshots
git add \*.png
if git diff-index --quiet HEAD; then
echo "No changes to visual tests. Exiting."
exit 0
else
echo "Commiting changes to visual tests"
git commit -m "${{ github.event.inputs.commitMessage || 'chore: update visual tests' }}"
git push
fi