forked from marimo-team/marimo
-
Notifications
You must be signed in to change notification settings - Fork 0
262 lines (228 loc) · 8.41 KB
/
Copy pathtest_fe.yaml
File metadata and controls
262 lines (228 loc) · 8.41 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
name: Test FE
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
TURBO_TEAM: marimo
MARIMO_SKIP_UPDATE_CHECK: 1
jobs:
changes:
runs-on: ubuntu-latest
outputs:
frontend: ${{ steps.filter.outputs.frontend }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: filter
with:
filters: |
frontend:
- 'frontend/**'
- 'packages/**'
lint_frontend:
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' }}
name: 🧹 Lint frontend
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
id-token: write # required for Doppler OIDC
defaults:
run:
shell: bash
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
- name: 🔐 Fetch Doppler secrets
# Skip on PRs from forks: id-token write is downgraded to read, so OIDC fails.
# Downstream tokens (TURBO_TOKEN, CODECOV_TOKEN) are optional and tolerate empty.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: dopplerhq/secrets-fetch-action@cd2efbf9a404504316435873eff298b82f7e0562 # v1.3.0
id: secrets
with:
auth-method: oidc
doppler-identity-id: ${{ vars.DOPPLER_IDENTITY_ID }}
doppler-project: marimo-oss
doppler-config: ci_test
- name: 📥 Install repo
uses: ./.github/actions/install
- name: 📦 pnpm dedupe
if: github.event_name == 'pull_request'
id: dedupe
run: pnpm dedupe --check
- name: 🧹 Lint
id: lint
env:
TURBO_TOKEN: ${{ steps.secrets.outputs.TURBO_TOKEN }}
run: pnpm turbo lint
- name: 🔒 Verify clean git tree after lint
id: lint_clean_tree
run: |
CHANGES="$(git status --porcelain)"
if [[ -n "$CHANGES" ]]; then
echo "Lint changed tracked files. Commit generated/autofixed files."
echo "$CHANGES"
git --no-pager diff --stat
exit 1
fi
- name: Summarize lint failure
if: failure() && steps.lint.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "lint"
command: "pnpm turbo lint"
- name: Summarize clean-tree failure after lint
if: failure() && steps.lint_clean_tree.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "clean-tree"
command: "pnpm turbo lint && git status --short"
- name: Summarize dedupe failure
if: failure() && steps.dedupe.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "dedupe"
command: "pnpm dedupe"
test_frontend:
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' }}
name: 🧪 Test frontend
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
id-token: write # required for Doppler OIDC
defaults:
run:
working-directory: ./frontend
shell: bash
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
- name: 🔐 Fetch Doppler secrets
# Skip on PRs from forks: id-token write is downgraded to read, so OIDC fails.
# Downstream tokens (TURBO_TOKEN, CODECOV_TOKEN) are optional and tolerate empty.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: dopplerhq/secrets-fetch-action@cd2efbf9a404504316435873eff298b82f7e0562 # v1.3.0
id: secrets
with:
auth-method: oidc
doppler-identity-id: ${{ vars.DOPPLER_IDENTITY_ID }}
doppler-project: marimo-oss
doppler-config: ci_test
- name: 📥 Install repo
uses: ./.github/actions/install
- name: 📋 Register tsc problem matcher
run: echo "::add-matcher::${{ github.workspace }}/.github/problemMatchers/tsc.json"
- name: 🔎 Type check
id: typecheck
env:
TURBO_TOKEN: ${{ steps.secrets.outputs.TURBO_TOKEN }}
run: pnpm turbo typecheck
- name: 🔒 Verify clean git tree after typecheck
id: typecheck_clean_tree
run: |
CHANGES="$(git status --porcelain)"
if [[ -n "$CHANGES" ]]; then
echo "Typecheck/codegen changed tracked files. Commit generated files."
echo "$CHANGES"
git --no-pager diff --stat
exit 1
fi
- name: 🧪 Test
id: test
env:
TURBO_TOKEN: ${{ steps.secrets.outputs.TURBO_TOKEN }}
run: pnpm turbo test
- name: Summarize typecheck failure
if: failure() && steps.typecheck.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "typecheck"
command: "pnpm turbo typecheck"
- name: Summarize test failure
if: failure() && steps.test.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "test"
command: "pnpm turbo test"
- name: Summarize clean-tree failure after typecheck
if: failure() && steps.typecheck_clean_tree.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "clean-tree"
command: "pnpm turbo typecheck && git status --short"
build_frontend:
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' }}
name: 📦 Build frontend
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write # required for Doppler OIDC
defaults:
run:
working-directory: ./frontend
shell: bash
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
- name: 🔐 Fetch Doppler secrets
# Skip on PRs from forks: id-token write is downgraded to read, so OIDC fails.
# Downstream tokens (TURBO_TOKEN, CODECOV_TOKEN) are optional and tolerate empty.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: dopplerhq/secrets-fetch-action@cd2efbf9a404504316435873eff298b82f7e0562 # v1.3.0
id: secrets
with:
auth-method: oidc
doppler-identity-id: ${{ vars.DOPPLER_IDENTITY_ID }}
doppler-project: marimo-oss
doppler-config: ci_test
- name: 📥 Install repo
uses: ./.github/actions/install
- name: 🔍 Check pinned deps
run: |
if ! grep -q '"react-hook-form": "7.54.2"' package.json; then
echo "Error: react-hook-form version in package.json must be exactly 7.54.2. As it breaks mo.ui.dataframe"
exit 1
fi
if ! grep -q '"html-to-image": "1.11.13"' package.json; then
echo "Error: html-to-image version in package.json must be exactly 1.11.13. Newer versions break matplotlib toolbars"
exit 1
fi
- name: 📦 Build
id: build
run: pnpm turbo build
env:
NODE_ENV: production
TURBO_TOKEN: ${{ steps.secrets.outputs.TURBO_TOKEN }}
- name: 📦 Build islands frontend
env:
NODE_ENV: production
VITE_MARIMO_ISLANDS: "true"
VITE_MARIMO_VERSION: "0.0.0"
TURBO_TOKEN: ${{ steps.secrets.outputs.TURBO_TOKEN }}
run: |
npm version 0.0.0 --no-git-tag-version
pnpm turbo build:islands
./islands/validate.sh
- name: Summarize build failure
if: failure() && steps.build.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "build"
command: "pnpm turbo build"