-
Notifications
You must be signed in to change notification settings - Fork 577
190 lines (154 loc) · 5.42 KB
/
ci.yaml
File metadata and controls
190 lines (154 loc) · 5.42 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
name: CI
on:
push:
branches: [master, development, 'development-*']
pull_request:
env:
# cache affixes and folders
PNPM_CACHE_AFFIX: pnpm
PNPM_CACHE_FOLDER: ~/.pnpm-store
PW_CACHE_AFFIX: pw
PW_CACHE_FOLDER: ~/.cache/ms-playwright
SENTRY_TELEMETRY_DISABLE: true
STORYBOOK_DISABLE_TELEMETRY: 1
jobs:
# Job to read Node version from .nvmrc
read-nvmrc:
runs-on: ubuntu-latest
outputs:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
sparse-checkout: |
.nvmrc
sparse-checkout-cone-mode: false
- name: Read .nvmrc
id: nvmrc
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
Build-And-Test:
needs: read-nvmrc
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
node-version: ['${{ needs.read-nvmrc.outputs.node-version }}']
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install package manager
uses: pnpm/action-setup@v4
# Configure pnpm store directory BEFORE setup-node tries to cache it
- name: Setup pnpm config
run: pnpm config set store-dir ${{ env.PNPM_CACHE_FOLDER }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Setup Additional Cache
uses: actions/cache@v5
id: additional_cache
with:
path: |
${{ env.PNPM_CACHE_FOLDER }}
${{ env.PW_CACHE_FOLDER }}
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/.browserslistrc') }}-${{ hashFiles('**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-
- name: Install dependencies
run: |
echo "Node version: $(node --version)"
echo "PNPM version: $(pnpm --version)"
pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Code-style
run: pnpm format:ci
- name: Test
env:
TEST_SERIAL_TIMEOUT: ${{ vars.TEST_SERIAL_TIMEOUT }}
run: |
pnpm test:ci
Sitemap-Check:
needs: read-nvmrc
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install package manager
uses: pnpm/action-setup@v4
- name: Setup pnpm config
run: pnpm config set store-dir ${{ env.PNPM_CACHE_FOLDER }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ needs.read-nvmrc.outputs.node-version }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Cache pnpm store
uses: actions/cache@v5
with:
path: ${{ env.PNPM_CACHE_FOLDER }}
key: ${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate sitemap
run: pnpx tsx scripts/update-sitemap.ts
- name: Check for sitemap drift
run: git diff --exit-code public/sitemap.xml public/default-sitemap.xml public/accounts-sitemap.xml
Storybook-Smoke-Tests:
needs: read-nvmrc
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
strategy:
matrix:
node-version: ['${{ needs.read-nvmrc.outputs.node-version }}', '22.x']
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install package manager
uses: pnpm/action-setup@v4
- name: Setup pnpm config
run: pnpm config set store-dir ${{ env.PNPM_CACHE_FOLDER }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Cache pnpm store
uses: actions/cache@v5
with:
path: ${{ env.PNPM_CACHE_FOLDER }}
key: ${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ env.PNPM_CACHE_AFFIX }}-
- name: Cache Playwright browsers
uses: actions/cache@v5
id: pw_cache
with:
path: ${{ env.PW_CACHE_FOLDER }}
key: ${{ runner.os }}-${{ env.PW_CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ env.PW_CACHE_AFFIX }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
if: steps.pw_cache.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps chromium
- name: Install Playwright system deps only
if: steps.pw_cache.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps chromium
- name: Run Storybook smoke tests
env:
STORYBOOK_DISABLE_TELEMETRY: ${{ env.STORYBOOK_DISABLE_TELEMETRY }}
run: pnpm test:sb