-
Notifications
You must be signed in to change notification settings - Fork 8
88 lines (79 loc) · 3.12 KB
/
Copy pathcheck-pr.yml
File metadata and controls
88 lines (79 loc) · 3.12 KB
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
name: Quality Gate
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
quality-gate:
name: Verify monorepo
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
container:
image: mcr.microsoft.com/playwright:v1.53.0-noble
strategy:
matrix:
package:
- packages/components
- packages/docs
- packages/placeholders
- packages/styles
- packages/theming
- packages/tokens
- packages/eslint-plugin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 10.0.0
run_install: false
- name: Install dependencies
run: pnpm i
- name: Verify package
run: |
echo "Running pnpm verify in ${{ matrix.package }}"
cd ${{ matrix.package }}
pnpm verify
# Check Chromatic for visual changes after all other checks have passed
chromatic-deployment-pr:
name: Verify Chromatic
needs: [quality-gate]
if: ${{!contains(github.event.pull_request.title, '[skip chromatic]') && !startsWith(github.event.pull_request.title, 'chore(security deps):')}}
runs-on: ubuntu-latest
steps:
# 👇 Version 2 of the action
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v2
with:
version: 10.0.0
# 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm
- name: Install dependencies
run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true pnpm i
# 👇 Build storybook with pnpm
- name: Build storybook
run: cd packages/docs && pnpm run build.chromatic
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@latest
# Options required to the GitHub Chromatic Action
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
# Speedup the build by not waiting until everything is sent to Chromatic
exitOnceUploaded: true
# TurboSnap is an advanced Chromatic feature that speeds up builds for faster UI testing and review using Git and Webpack’s dependency graph
onlyChanged: false
# We need to manually build storybook with pnpm
storybookBuildDir: packages/docs/dist/storybook