-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (43 loc) · 1.34 KB
/
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
52
53
name: Visual tests
on:
push:
branches:
- main
workflow_dispatch:
jobs:
storybook-tests:
name: Storybook Tests
timeout-minutes: 60
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: pnpm install
- name: Install Playwright
run: pnpm dlx playwright install
- name: Create the static pages directory locally in CI
run: pnpm --prefix ./packages/component-library run build-storybook
- name: Run Tests
id: storybookTests
run: |
cd ./packages/component-library &&
npx concurrently --kill-others --success first --names "SB,TEST" --prefix-colors "magenta,blue" \
"http-server storybook-static -a 127.0.0.1 --port 6006" \
"wait-on http://127.0.0.1:6006 && pnpm run test-storybook"
- name: Archive visual test diffs
uses: actions/upload-artifact@v3
if: always()
with:
name: visual-test-diffs
path: ./packages/component-library/__snapshots__