-
Notifications
You must be signed in to change notification settings - Fork 524
105 lines (90 loc) · 2.75 KB
/
chromatic.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Chromatic
# Runs chromatic on:
# - every push to main (to create a chromatic baseline)
# - every pull request where there are changes in stories/ or packages/ and the PR is not in draft mode
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- "stories/**"
- "packages/**"
- "website/**"
deployment_status:
permissions:
id-token: write
contents: read
jobs:
playwright:
name: Playwright Tests with Chromatic on ${{ github.event.deployment_status.environment }}
if: github.event.pull_request.draft == false && github.repository == 'FormidableLabs/victory' && github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.49.0-jammy
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
with:
node-version: 18.x
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Install Test Dependencies
run: pnpm install
- name: Install Playwright
run: pnpm playwright install --with-deps
- name: Run Playwright Tests
run: npx playwright test
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-results
path: ./playwright-report
retention-days: 30
chromatic:
name: Run Chromatic
needs: playwright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
with:
node-version: 18.x
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install
- name: Download Playwright test results
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}
- name: Run Chromatic
uses: chromaui/action@latest
with:
playwright: true
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybook:
name: Storybook Publish
if: github.event.pull_request.draft == false && github.repository == 'FormidableLabs/victory'
runs-on: ubuntu-latest
steps:
# requires all branches and tags to be fetched for chromatic
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
with:
node-version: 18.x
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}