-
-
Notifications
You must be signed in to change notification settings - Fork 994
215 lines (195 loc) · 7.52 KB
/
Copy pathci.yml
File metadata and controls
215 lines (195 loc) · 7.52 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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: CI
on:
push:
branches: [main]
merge_group:
pull_request:
branches: [main]
# Automatically cancel in-progress actions on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: 22
ASTRO_TELEMETRY_DISABLED: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
docs: ${{ steps.filter.outputs.docs }}
docs_ja: ${{ steps.filter.outputs.docs_ja }}
docs_en: ${{ steps.filter.outputs.docs_en }}
docs_not_content: ${{ steps.filter.outputs.docs_not_content }}
packages: ${{ steps.filter.outputs.packages }}
ci: ${{ steps.filter.outputs.ci }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
# When updating filters here, make sure to also add or remove them from the
# outputs block above.
with:
filters: |
docs:
- 'docs/**'
docs_ja:
- 'docs/src/content/docs/ja/**'
docs_en:
- 'docs/src/content/docs/**'
# Exclude languages with a two-letter code
- '!docs/src/content/docs/{a..z}{a..z}/**'
# Exclude languages with a region subtag
- '!docs/src/content/docs/{a..z}{a..z}-{a..z}{a..z}/**'
docs_not_content:
- 'docs/**'
- '!docs/src/content/docs/**'
packages:
- 'packages/**'
ci:
- '.github/workflows/ci.yml'
unit-test:
name: Run unit tests
needs: changes
if: ${{ needs.changes.outputs.packages == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- run: pnpm i
- name: Test packages
run: pnpm -r test:coverage
e2e-test:
name: 'Run E2E tests (${{ matrix.os }})'
needs: changes
if: ${{ needs.changes.outputs.packages == 'true' || needs.changes.outputs.ci == 'true' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Uninstall man-db to prevent man page updates taking a long time after package installations
# on Ubuntu 24.04.
# https://github.com/actions/runner/issues/4030
# https://github.com/actions/runner-images/issues/10977
- name: Uninstall man-db
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get remove man-db
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- run: pnpm i
- name: Test packages (Linux)
if: matrix.os == 'ubuntu-latest'
run: pnpm -r test:e2e:chrome
# Firefox is used for Windows E2E tests as Chrome on Windows requires the installation of the
# Server Media Foundation windows feature, which can take up to 3 minutes to install on CI.
# https://github.com/microsoft/playwright/blob/e7bff526433b6dcb02801763ab5b1c6407902d47/packages/playwright-core/src/server/registry/dependencies.ts#L79-L89
- name: Test packages (Windows)
if: matrix.os == 'windows-latest'
run: pnpm -r test:e2e:firefox
type-check:
name: Run type checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- run: pnpm i
- name: Generate docs types
working-directory: docs
run: pnpm astro sync
- name: Type check packages
run: pnpm typecheck
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- run: pnpm i
- name: Generate types
working-directory: ./docs
run: pnpm astro sync
- name: Run linter
run: pnpm lint
a11y:
name: Check for accessibility issues
needs: changes
if: ${{ needs.changes.outputs.docs_not_content == 'true' || needs.changes.outputs.docs_ja == 'true' || needs.changes.outputs.docs_en == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.packages == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Uninstall man-db to prevent man page updates taking a long time after package installations
# on Ubuntu 24.04.
# https://github.com/actions/runner/issues/4030
# https://github.com/actions/runner-images/issues/10977
- name: Uninstall man-db
run: |
sudo apt-get update
sudo apt-get remove man-db
- name: Setup PNPM
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install Dependencies
run: pnpm i
- name: Run accessibility audit
working-directory: ./docs
run: pnpm t
windows-smoke:
name: Docs site builds on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- run: pnpm i
- name: Build docs site
working-directory: ./docs
run: pnpm build
links:
name: Check for broken links
needs: changes
if: ${{ needs.changes.outputs.docs == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup PNPM
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install Dependencies
run: pnpm i
- name: Build docs site and check links
working-directory: ./docs
run: pnpm linkcheck