-
Notifications
You must be signed in to change notification settings - Fork 21
147 lines (127 loc) · 3.9 KB
/
quality.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: quality
on:
pull_request:
branches:
- main
- 'canary/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
assign-pr-owner:
runs-on: ubuntu-latest
name: PR assignment
steps:
- name: Assign PR
uses: toshimaru/[email protected]
if: github.event_name == 'pull_request' && github.event.action == 'opened'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/composite-actions/install
- name: Lint
run: npm run lint
typecheck:
runs-on: ubuntu-latest
name: Typecheck
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/composite-actions/install
- name: Type checking
run: npm run typecheck
test:
runs-on: ubuntu-latest
name: Test
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/composite-actions/install
- name: Test
run: npm run test:coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
files: ./dist/coverage/coverage.json
a11y:
runs-on: ubuntu-latest
name: Accessibility
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
uses: tj-actions/changed-files@v36
id: files
with:
files: ./packages/components/**/*.{ts,tsx,mdx,json}
- name: Install
if: steps.files.outputs.all_changed_files_count > 0
uses: ./.github/composite-actions/install
- name: Build Project Artifacts
if: steps.files.outputs.all_changed_files_count > 0
run: npm run storybook:build
- name: Serve Storybook files
if: steps.files.outputs.all_changed_files_count > 0
uses: Eun/http-server-action@v1
with:
directory: ./dist
port: 6006
- name: Accessibility checking
if: steps.files.outputs.all_changed_files_count > 0
run: node bin/check-a11y.js -f ${{ steps.files.outputs.all_changed_files }}
visual-testing:
runs-on: ubuntu-latest
name: Visual testing
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install
uses: ./.github/composite-actions/install
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: 'storybook:build'
onlyChanged: true
untraced: 'packages/utils/\*\*"'
deploy:
runs-on: ubuntu-latest
name: Deploy
environment:
name: ${{ github.event_name != 'pull_request' && 'Production' || 'Preview'}}
url: ${{ steps.deployment.outputs.url }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install
uses: ./.github/composite-actions/install
- name: Install Vercel CLI
run: npm install --global vercel@latest --no-save --no-fund --no-audit --no-scripts
- name: Build Storybook
run: npm run storybook:build
- name: Build tailwind config viewer
run: npm run tailwind-config-viewer:build
- name: Deploy Storybook to Vercel
id: deployment
run: |
DEPLOYMENT_URL=$(vercel deploy --token $VERCEL_TOKEN --yes)
echo "::set-output name=url::$(echo $DEPLOYMENT_URL)"
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN}}