-
Notifications
You must be signed in to change notification settings - Fork 21
167 lines (141 loc) · 4.01 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: quality
env:
FORCE_COLOR: 3
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@v4
with:
fetch-depth: 0
- 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@v4
with:
fetch-depth: 0
- name: Install
uses: ./.github/composite-actions/install
- name: Type checking
run: npm run typecheck
test:
runs-on: ubuntu-latest
name: Unit testing
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
uses: ./.github/composite-actions/install
- name: Test
run: npm run test:coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
file: ./dist/coverage/.coverage.json
token: ${{ secrets.CODECOV_TOKEN }}
name: Codecov UI
codecov_yml_path: ./.codecov.yml
test-e2e:
runs-on: ubuntu-latest
name: E2E testing
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
uses: tj-actions/changed-files@v41
id: e2efiles
with:
files: |
./e2e/**/*.{ts,tsx}
./packages/components/**/*.{ts,tsx,mdx,json}
- name: E2E testing
if: steps.e2efiles.outputs.all_changed_files_count > 0
uses: ./.github/composite-actions/e2e
test-a11y:
runs-on: ubuntu-latest
name: Accessibility testing
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
uses: tj-actions/changed-files@v41
id: a11yfiles
with:
files: |
./e2e/a11y/pages/**/*.tsx
./packages/components/**/*.{ts,tsx,mdx,json}
- name: Accessibility checking
if: steps.a11yfiles.outputs.all_changed_files_count > 0
uses: ./.github/composite-actions/pw-a11y
deploy:
runs-on: ubuntu-latest
name: Deployment
environment:
name: ${{ github.event_name != 'pull_request' && 'Production' || 'Preview'}}
url: ${{ steps.deployment.outputs.url }}
steps:
- name: Checkout
uses: actions/checkout@v4
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}}
security:
name: Security
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Lava Action
uses: adevinta/lava-action@v0