-
Notifications
You must be signed in to change notification settings - Fork 7
206 lines (184 loc) · 6.87 KB
/
ci.yml
File metadata and controls
206 lines (184 loc) · 6.87 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
name: CI
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: read
pull-requests: read
jobs:
detect-changes:
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
name: Detect Changes
outputs:
docs: ${{ steps.filter.outputs.docs }}
appkit: ${{ steps.filter.outputs.appkit }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
docs:
- 'docs/**'
- 'packages/**'
appkit:
- '!docs/**'
lint_and_typecheck:
name: Lint & Type Check
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check generated types are up to date
run: |
pnpm run generate:types
if ! git diff --exit-code packages/shared/src/schemas/plugin-manifest.generated.ts packages/appkit/src/registry/types.generated.ts; then
echo "❌ Error: Generated types are out of sync with plugin-manifest.schema.json."
echo ""
echo "To fix this:"
echo " 1. Run: pnpm run generate:types"
echo " 2. Review and commit the changes"
echo ""
exit 1
fi
- name: Run Biome Check
run: pnpm run check
- name: Run Types Check
run: pnpm run typecheck
- name: Run Knip Check
run: pnpm run knip
- name: Run License Check
run: pnpm run check:licenses
test:
name: Unit Tests
needs: detect-changes
if: needs.detect-changes.outputs.appkit == 'true'
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run Tests
run: pnpm test
playground-integration-test:
name: Playground Integration Tests
needs: detect-changes
if: needs.detect-changes.outputs.appkit == 'true'
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: pnpm --filter=dev-playground exec playwright install --with-deps chromium
- name: Build packages
run: pnpm build
- name: Run Integration Tests
run: pnpm --filter=dev-playground test:integration
env:
APPKIT_E2E_TEST: 'true'
DATABRICKS_WAREHOUSE_ID: e2e-mock
DATABRICKS_WORKSPACE_ID: e2e-mock
pr-template-artifact:
name: PR Template Artifact
needs: detect-changes
if: needs.detect-changes.outputs.appkit == 'true'
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Set PR version
id: version
env:
BRANCH: ${{ github.head_ref }}
run: |
SANITIZED_BRANCH=$(echo "$BRANCH" | sed 's/[^a-zA-Z0-9-]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
CURRENT_VERSION=$(node -p "require('./packages/appkit/package.json').version")
PR_VERSION="${CURRENT_VERSION}-${SANITIZED_BRANCH}"
echo "version=$PR_VERSION" >> "$GITHUB_OUTPUT"
pnpm exec tsx tools/sync-versions.ts "$PR_VERSION"
- name: Build SDK tarballs
run: pnpm pack:sdk
- name: Prepare template artifact
run: pnpm exec tsx tools/prepare-pr-template.ts "${{ steps.version.outputs.version }}"
- name: Install template dependencies
working-directory: pr-template
run: npm install
- name: Create zip artifact
working-directory: pr-template
run: zip -r ../pr-template.zip . -x 'node_modules/*'
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: appkit-template-${{ steps.version.outputs.version }}
path: pr-template.zip
docs-build:
name: Docs Build
needs: detect-changes
if: needs.detect-changes.outputs.docs == 'true'
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build Docs
run: pnpm run docs:build
- name: Check Generated Docs
run: pnpm run docs:check
- name: Check for uncommitted docs changes
run: |
if ! git diff --exit-code docs/docs/api/; then
echo "❌ Error: Generated docs are out of sync with the codebase."
echo ""
echo "The API documentation in docs/docs/api/ has changes after running docs:generate."
echo "This means the committed docs don't match the current package code."
echo ""
echo "To fix this:"
echo " 1. Run: pnpm docs:build"
echo " 2. Run: pnpm docs:check:fix"
echo " 3. Review and commit the changes"
echo ""
exit 1
fi