-
Notifications
You must be signed in to change notification settings - Fork 2
233 lines (193 loc) · 6.62 KB
/
ci.yml
File metadata and controls
233 lines (193 loc) · 6.62 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
name: CI
on:
pull_request:
branches: [main]
env:
MIN_COVERAGE: ${{ vars.MIN_COVERAGE }}
jobs:
website:
name: Website Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ vars.DART_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: website/package-lock.json
- name: Install dependencies
working-directory: website
run: npm ci
- name: Get Playwright version
id: playwright-version
working-directory: website
run: echo "version=$(npm ls @playwright/test --json | jq -r '.dependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: website
run: npx playwright install --with-deps chromium
- name: Install Playwright deps only (cached)
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- name: Build website
working-directory: website
run: npm run build
- name: Run tests
working-directory: website
run: npm test
packages:
name: Lint, Test & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
dart-version: ${{ vars.DART_VERSION }}
- name: Install tools
run: |
npm install -g cspell
dart pub global activate coverage
- name: Get all dependencies
run: |
for dir in packages/* examples/* tools/build; do
if [ -d "$dir" ] && [ -f "$dir/pubspec.yaml" ]; then
echo "::group::$dir"
cd $dir && dart pub get && cd - > /dev/null
echo "::endgroup::"
fi
done
- name: Install npm dependencies
run: |
for dir in packages/* examples/*; do
if [ -d "$dir" ] && [ -f "$dir/package.json" ]; then
echo "::group::npm install $dir"
cd $dir && npm install && cd - > /dev/null
echo "::endgroup::"
fi
done
- name: Spell check
run: cspell "**/*.md" "**/*.dart" "**/*.ts" --no-progress
- name: Check formatting
run: |
dart format --set-exit-if-changed packages/
dart format --set-exit-if-changed examples/
dart format --set-exit-if-changed tools/build
- name: Analyze
run: |
for dir in packages/* examples/* tools/build; do
if [ -d "$dir" ] && [ -f "$dir/pubspec.yaml" ]; then
echo "::group::Analyzing $dir"
cd $dir && dart analyze --no-fatal-warnings && cd - > /dev/null
echo "::endgroup::"
fi
done
- name: Test Tier 1
run: ./tools/test.sh --tier 1
- name: Test Tier 2
run: ./tools/test.sh --tier 2
- name: Test Tier 3
run: ./tools/test.sh --tier 3
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: logs/
retention-days: 7
too-many-cooks-mcp:
name: Too Many Cooks MCP Server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ vars.DART_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: examples/too_many_cooks/package-lock.json
- name: Get tools/build dependencies
working-directory: tools/build
run: dart pub get
- name: Get MCP server dependencies
working-directory: examples/too_many_cooks
run: |
dart pub get
npm ci
- name: Compile MCP server
run: |
set -e
dart compile js -o examples/too_many_cooks/build/bin/server.js examples/too_many_cooks/bin/server.dart
dart run tools/build/add_preamble.dart \
examples/too_many_cooks/build/bin/server.js \
examples/too_many_cooks/build/bin/server_node.js \
--shebang
- name: Verify server exists
run: |
set -e
test -f examples/too_many_cooks/build/bin/server_node.js || (echo "Server build failed!" && exit 1)
echo "MCP server built successfully"
vscode-extension:
name: VSCode Extension Tests
runs-on: ubuntu-latest
needs: too-many-cooks-mcp
steps:
- uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ vars.DART_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: examples/too_many_cooks_vscode_extension/package-lock.json
- name: Get tools/build dependencies
working-directory: tools/build
run: dart pub get
- name: Build Too Many Cooks MCP server
run: |
set -e
cd examples/too_many_cooks
dart pub get
npm ci
dart compile js -o build/bin/server.js bin/server.dart
cd ../..
dart run tools/build/add_preamble.dart \
examples/too_many_cooks/build/bin/server.js \
examples/too_many_cooks/build/bin/server_node.js \
--shebang
- name: Get dart_node_vsix dependencies
working-directory: packages/dart_node_vsix
run: dart pub get
- name: Get extension dependencies (Dart)
working-directory: examples/too_many_cooks_vscode_extension
run: dart pub get
- name: Get extension dependencies (npm)
working-directory: examples/too_many_cooks_vscode_extension
run: npm ci
- name: Compile extension and tests
working-directory: examples/too_many_cooks_vscode_extension
run: |
set -e
npm run pretest
- name: Run VSCode extension tests
uses: coactions/setup-xvfb@v1
with:
run: npm test
working-directory: examples/too_many_cooks_vscode_extension