Elffuss BraidHub

kikocis/continue public

627d7d0d1f85 · 34.2 KiBRawPermalink
1name: PR checks
2
3# PR Checks run on all PRs to the main branch and must pass before merging.
4on:
5 pull_request:
6 branches:
7 - main
8
9 push:
10 branches:
11 - main
12
13jobs:
14 install-root:
15 runs-on: ubuntu-latest
16 steps:
17 - uses: actions/checkout@v4
18
19 - uses: actions/setup-node@v4
20 with:
21 node-version-file: ".nvmrc"
22
23 - uses: actions/cache@v4
24 id: root-cache
25 with:
26 path: node_modules
27 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
28
29 - name: Install root dependencies
30 if: steps.root-cache.outputs.cache-hit != 'true'
31 run: npm ci
32
33 prettier-check:
34 needs: install-root
35 runs-on: ubuntu-latest
36 steps:
37 - uses: actions/checkout@v4
38
39 - uses: actions/setup-node@v4
40 with:
41 node-version-file: ".nvmrc"
42
43 - uses: actions/cache@v4
44 with:
45 path: node_modules
46 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
47
48 - name: Check code formatting with Prettier
49 run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}" --ignore-path .gitignore --ignore-path .prettierignore
50
51 install-config-yaml:
52 needs: install-root
53 runs-on: ${{ matrix.os }}
54 strategy:
55 matrix:
56 os: [ubuntu-latest, macos-latest]
57 steps:
58 - uses: actions/checkout@v4
59
60 - uses: actions/setup-node@v4
61 with:
62 node-version-file: ".nvmrc"
63
64 - uses: actions/cache@v4
65 with:
66 path: node_modules
67 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
68
69 - uses: actions/cache@v4
70 id: config-yaml-cache
71 with:
72 path: packages/config-yaml/node_modules
73 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
74
75 - name: Install config-yaml dependencies
76 if: steps.config-yaml-cache.outputs.cache-hit != 'true'
77 run: |
78 cd packages/config-yaml
79 npm ci
80
81 install-openai-adapters:
82 needs: install-root
83 runs-on: ${{ matrix.os }}
84 strategy:
85 matrix:
86 os: [ubuntu-latest, macos-latest]
87 steps:
88 - uses: actions/checkout@v4
89
90 - uses: actions/setup-node@v4
91 with:
92 node-version-file: ".nvmrc"
93
94 - uses: actions/cache@v4
95 with:
96 path: node_modules
97 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
98
99 - uses: actions/cache@v4
100 id: openai-adapters-cache
101 with:
102 path: packages/openai-adapters/node_modules
103 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
104
105 - name: Install openai-adapters dependencies
106 if: steps.openai-adapters-cache.outputs.cache-hit != 'true'
107 run: |
108 cd packages/openai-adapters
109 npm ci
110
111 config-yaml-checks:
112 needs: install-config-yaml
113 runs-on: ubuntu-latest
114 steps:
115 - uses: actions/checkout@v4
116
117 - uses: actions/setup-node@v4
118 with:
119 node-version-file: ".nvmrc"
120
121 - uses: actions/cache@v4
122 with:
123 path: node_modules
124 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
125
126 - uses: actions/cache@v4
127 id: config-yaml-cache
128 with:
129 path: packages/config-yaml/node_modules
130 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
131
132 - name: Build and check config-yaml
133 run: |
134 cd packages/config-yaml
135 npx tsc --noEmit
136 # Tests are currently failing, commenting out for now
137 # npm test
138 npm run build
139
140 install-core:
141 needs: install-root
142 runs-on: ${{ matrix.os }}
143 strategy:
144 matrix:
145 os: [ubuntu-latest, macos-latest]
146 steps:
147 - uses: actions/checkout@v4
148
149 - uses: actions/setup-node@v4
150 with:
151 node-version-file: ".nvmrc"
152
153 - uses: actions/cache@v4
154 id: root-cache
155 with:
156 path: node_modules
157 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
158
159 - uses: actions/cache@v4
160 id: core-cache
161 with:
162 path: core/node_modules
163 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
164
165 - name: Install core dependencies
166 if: steps.core-cache.outputs.cache-hit != 'true'
167 run: |
168 cd core
169 npm ci
170
171 core-checks:
172 needs: [install-core, install-config-yaml, install-openai-adapters]
173 runs-on: ubuntu-latest
174 steps:
175 - uses: actions/checkout@v4
176
177 - uses: actions/setup-node@v4
178 with:
179 node-version-file: ".nvmrc"
180
181 - uses: actions/cache@v4
182 id: root-cache
183 with:
184 path: node_modules
185 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
186
187 - uses: actions/cache@v4
188 id: core-cache
189 with:
190 path: core/node_modules
191 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
192
193 - uses: actions/cache@v4
194 id: config-yaml-cache
195 with:
196 path: packages/config-yaml/node_modules
197 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
198
199 - uses: actions/cache@v4
200 id: openai-adapters-cache
201 with:
202 path: packages/openai-adapters/node_modules
203 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
204
205 - name: Build config-yaml
206 run: |
207 cd packages/config-yaml
208 npm run build
209
210 - name: Build openai-adapters
211 run: |
212 cd packages/openai-adapters
213 npm run build
214 - name: Type check and lint
215 run: |
216 cd core
217 npx tsc --noEmit
218 npm run lint
219 env:
220 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
221
222 install-gui:
223 needs:
224 [install-root, install-core, install-config-yaml, install-openai-adapters]
225 runs-on: ubuntu-latest
226 steps:
227 - uses: actions/checkout@v4
228
229 - uses: actions/setup-node@v4
230 with:
231 node-version-file: ".nvmrc"
232
233 - uses: actions/cache@v4
234 with:
235 path: node_modules
236 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
237
238 - uses: actions/cache@v4
239 with:
240 path: core/node_modules
241 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
242
243 - uses: actions/cache@v4
244 id: gui-cache
245 with:
246 path: gui/node_modules
247 key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
248
249 - uses: actions/cache@v4
250 id: config-yaml-cache
251 with:
252 path: packages/config-yaml/node_modules
253 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
254
255 - uses: actions/cache@v4
256 id: openai-adapters-cache
257 with:
258 path: packages/openai-adapters/node_modules
259 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
260
261 - name: Build config-yaml
262 run: |
263 cd packages/config-yaml
264 npm run build
265
266 - name: Build openai-adapters
267 run: |
268 cd packages/openai-adapters
269 npm run build
270
271 - name: Install gui dependencies
272 if: steps.gui-cache.outputs.cache-hit != 'true'
273 run: |
274 cd gui
275 npm ci
276
277 gui-checks:
278 needs: install-gui
279 runs-on: ubuntu-latest
280 steps:
281 - uses: actions/checkout@v4
282 - uses: actions/setup-node@v4
283 with:
284 node-version-file: ".nvmrc"
285
286 - uses: actions/cache@v4
287 with:
288 path: node_modules
289 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
290
291 - uses: actions/cache@v4
292 with:
293 path: core/node_modules
294 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
295
296 - uses: actions/cache@v4
297 id: gui-cache
298 with:
299 path: gui/node_modules
300 key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
301
302 - uses: actions/cache@v4
303 id: openai-adapters-cache
304 with:
305 path: packages/openai-adapters/node_modules
306 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
307
308 - uses: actions/cache@v4
309 id: config-yaml-cache
310 with:
311 path: packages/config-yaml/node_modules
312 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
313
314 - name: Build config-yaml
315 run: |
316 cd packages/config-yaml
317 npm run build
318
319 - name: Build openai-adapters
320 run: |
321 cd packages/openai-adapters
322 npm run build
323
324 - name: Type check and lint
325 run: |
326 cd gui
327 npx tsc --noEmit
328 npm run lint
329
330 binary-checks:
331 needs:
332 [install-root, install-core, install-config-yaml, install-openai-adapters]
333 runs-on: ubuntu-latest
334 steps:
335 - uses: actions/checkout@v4
336
337 - uses: actions/setup-node@v4
338 with:
339 node-version-file: ".nvmrc"
340
341 - uses: actions/cache@v4
342 with:
343 path: node_modules
344 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
345
346 - uses: actions/cache@v4
347 with:
348 path: core/node_modules
349 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
350
351 - uses: actions/cache@v4
352 id: binary-cache
353 with:
354 path: binary/node_modules
355 key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }}
356
357 - uses: actions/cache@v4
358 id: config-yaml-cache
359 with:
360 path: packages/config-yaml/node_modules
361 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
362
363 - uses: actions/cache@v4
364 id: openai-adapters-cache
365 with:
366 path: packages/openai-adapters/node_modules
367 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
368
369 - name: Build config-yaml
370 run: |
371 cd packages/config-yaml
372 npm run build
373
374 - name: Build openai-adapters
375 run: |
376 cd packages/openai-adapters
377 npm run build
378
379 - name: Install binary dependencies
380 if: steps.binary-cache.outputs.cache-hit != 'true'
381 run: |
382 cd binary
383 npm ci
384
385 - name: Type check
386 run: |
387 cd binary
388 npx tsc --noEmit
389
390 install-vscode:
391 needs:
392 [install-root, install-core, install-config-yaml, install-openai-adapters]
393 runs-on: ${{ matrix.os }}
394 strategy:
395 matrix:
396 os: [ubuntu-latest, macos-latest]
397 steps:
398 - uses: actions/checkout@v4
399
400 - uses: actions/setup-node@v4
401 with:
402 node-version-file: ".nvmrc"
403
404 - uses: actions/cache@v4
405 with:
406 path: node_modules
407 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
408
409 - uses: actions/cache@v4
410 with:
411 path: core/node_modules
412 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
413
414 - uses: actions/cache@v4
415 id: vscode-cache
416 with:
417 path: extensions/vscode/node_modules
418 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
419
420 - uses: actions/cache@v4
421 id: config-yaml-cache
422 with:
423 path: packages/config-yaml/node_modules
424 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
425
426 - uses: actions/cache@v4
427 id: openai-adapters-cache
428 with:
429 path: packages/openai-adapters/node_modules
430 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
431
432 - name: Build config-yaml
433 run: |
434 cd packages/config-yaml
435 npm run build
436
437 - name: Build openai-adapters
438 run: |
439 cd packages/openai-adapters
440 npm run build
441
442 - name: Install vscode dependencies
443 if: steps.vscode-cache.outputs.cache-hit != 'true'
444 run: |
445 cd extensions/vscode
446 npm ci
447 env:
448 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
449
450 vscode-checks:
451 needs: install-vscode
452 runs-on: ubuntu-latest
453 steps:
454 - uses: actions/checkout@v4
455
456 - uses: actions/setup-node@v4
457 with:
458 node-version-file: ".nvmrc"
459
460 - uses: actions/cache@v4
461 with:
462 path: node_modules
463 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
464
465 - uses: actions/cache@v4
466 with:
467 path: core/node_modules
468 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
469
470 - uses: actions/cache@v4
471 id: vscode-cache
472 with:
473 path: extensions/vscode/node_modules
474 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
475
476 - uses: actions/cache@v4
477 id: config-yaml-cache
478 with:
479 path: packages/config-yaml/node_modules
480 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
481
482 - uses: actions/cache@v4
483 id: openai-adapters-cache
484 with:
485 path: packages/openai-adapters/node_modules
486 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
487
488 - name: Build config-yaml
489 run: |
490 cd packages/config-yaml
491 npm run build
492
493 - name: Build openai-adapters
494 run: |
495 cd packages/openai-adapters
496 npm run build
497
498 - name: Type check and lint
499 run: |
500 cd extensions/vscode
501 npm run write-build-timestamp
502 npx tsc --noEmit
503 npm run lint
504
505 - name: Run vitest tests
506 run: |
507 cd extensions/vscode
508 npm run vitest
509
510 core-tests:
511 needs: [install-core, install-config-yaml, install-openai-adapters]
512 runs-on: ubuntu-latest
513 steps:
514 - uses: actions/checkout@v4
515
516 - uses: actions/setup-node@v4
517 with:
518 node-version-file: ".nvmrc"
519
520 - uses: actions/cache@v4
521 with:
522 path: core/node_modules
523 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
524
525 - uses: actions/cache@v4
526 id: config-yaml-cache
527 with:
528 path: packages/config-yaml/node_modules
529 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
530
531 - uses: actions/cache@v4
532 id: openai-adapters-cache
533 with:
534 path: packages/openai-adapters/node_modules
535 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
536
537 - name: Build config-yaml
538 run: |
539 cd packages/config-yaml
540 npm run build
541
542 - name: Build openai-adapters
543 run: |
544 cd packages/openai-adapters
545 npm run build
546
547 - name: Run core tests
548 run: |
549 cd core
550 npm test
551 npm run vitest
552 env:
553 IGNORE_API_KEY_TESTS: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }}
554 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
555 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
556 GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
557 MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
558 AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
559 AZURE_FOUNDRY_CODESTRAL_API_KEY: ${{ secrets.AZURE_FOUNDRY_CODESTRAL_API_KEY }}
560 AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
561 AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
562
563 package-tests:
564 runs-on: ubuntu-latest
565 steps:
566 - uses: actions/checkout@v4
567
568 - uses: actions/setup-node@v4
569 with:
570 node-version-file: ".nvmrc"
571
572 - uses: actions/cache@v4
573 with:
574 path: core/node_modules
575 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
576
577 - name: Install dependencies
578 run: |
579 cd packages/config-yaml
580 npm ci
581
582 - name: Run config-yaml tests
583 run: |
584 cd packages/config-yaml
585 npm test
586
587 openai-adapters-tests:
588 needs: install-openai-adapters
589 runs-on: ubuntu-latest
590 steps:
591 - uses: actions/checkout@v4
592
593 - uses: actions/setup-node@v4
594 with:
595 node-version-file: ".nvmrc"
596
597 - uses: actions/cache@v4
598 with:
599 path: node_modules
600 key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
601
602 - uses: actions/cache@v4
603 id: openai-adapters-cache
604 with:
605 path: packages/openai-adapters/node_modules
606 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
607
608 - name: Run openai-adapters tests
609 run: |
610 cd packages/openai-adapters
611 npm test
612 env:
613 IGNORE_API_KEY_TESTS: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }}
614 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
615 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
616 GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
617 MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
618 AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
619 AZURE_FOUNDRY_CODESTRAL_API_KEY: ${{ secrets.AZURE_FOUNDRY_CODESTRAL_API_KEY }}
620 AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
621 AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
622 VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
623
624 vscode-get-test-file-matrix:
625 runs-on: ubuntu-latest
626 needs: [install-root, install-vscode, install-config-yaml]
627 outputs:
628 test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}
629 steps:
630 - uses: actions/checkout@v4
631
632 - name: Cache node modules
633 uses: actions/cache@v4
634 with:
635 path: extensions/vscode/node_modules
636 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
637
638 - uses: actions/cache@v4
639 id: config-yaml-cache
640 with:
641 path: packages/config-yaml/node_modules
642 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
643
644 - name: Build config-yaml
645 run: |
646 cd packages/config-yaml
647 npm run build
648
649 - name: Get test files
650 id: vscode-get-test-file-matrix
651 run: |
652 cd extensions/vscode
653 npm ci
654 npm run e2e:compile
655 if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" || "${{ github.actor }}" == "dependabot[bot]" ]]; then
656 # Exclude SSH tests for forks
657 FILES=$(ls -1 e2e/_output/tests/*.test.js | grep -v "SSH" | jq -R . | jq -s .)
658 else
659 # Include all tests for non-forks
660 FILES=$(ls -1 e2e/_output/tests/*.test.js | jq -R . | jq -s .)
661 fi
662 echo "test_file_matrix<<EOF" >> $GITHUB_OUTPUT
663 echo "$FILES" >> $GITHUB_OUTPUT
664 echo "EOF" >> $GITHUB_OUTPUT
665 env:
666 # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
667 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
668
669 - name: Debug Outputs
670 run: |
671 echo "Test files: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}"
672
673 vscode-package-extension:
674 runs-on: ${{ matrix.os }}
675 strategy:
676 matrix:
677 os: [ubuntu-latest, macos-latest]
678 needs:
679 [
680 install-vscode,
681 install-core,
682 install-config-yaml,
683 install-openai-adapters,
684 ]
685 steps:
686 - uses: actions/checkout@v4
687
688 - uses: actions/setup-node@v4
689 with:
690 node-version-file: ".nvmrc"
691
692 - uses: actions/cache@v4
693 id: vscode-node-modules-cache
694 with:
695 path: extensions/vscode/node_modules
696 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
697
698 - uses: actions/cache@v4
699 id: core-node-modules-cache
700 with:
701 path: core/node_modules
702 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
703
704 - uses: actions/cache@v4
705 id: config-yaml-cache
706 with:
707 path: packages/config-yaml/node_modules
708 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
709
710 - uses: actions/cache@v4
711 id: openai-adapters-cache
712 with:
713 path: packages/openai-adapters/node_modules
714 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
715
716 - name: Build config-yaml
717 run: |
718 cd packages/config-yaml
719 npm run build
720
721 - name: Build openai-adapters
722 run: |
723 cd packages/openai-adapters
724 npm run build
725
726 - name: Package extension
727 run: |
728 cd extensions/vscode
729 npm run package
730
731 - name: Upload build artifact
732 uses: actions/upload-artifact@v4
733 with:
734 name: vscode-extension-build-${{ runner.os }}
735 path: extensions/vscode/build
736
737 vscode-download-e2e-dependencies:
738 runs-on: ubuntu-latest
739 needs:
740 [
741 install-vscode,
742 install-core,
743 install-config-yaml,
744 install-openai-adapters,
745 ]
746 steps:
747 - uses: actions/checkout@v4
748
749 - uses: actions/setup-node@v4
750 with:
751 node-version-file: ".nvmrc"
752
753 - uses: actions/cache@v4
754 id: vscode-node-modules-cache
755 with:
756 path: extensions/vscode/node_modules
757 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
758
759 - uses: actions/cache@v4
760 id: storage-cache
761 with:
762 path: extensions/vscode/e2e/storage
763 key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }}
764
765 - uses: actions/cache@v4
766 id: config-yaml-cache
767 with:
768 path: packages/config-yaml/node_modules
769 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
770
771 - name: Build config-yaml
772 run: |
773 cd packages/config-yaml
774 npm run build
775
776 - name: Download Dependencies
777 if: steps.storage-cache.outputs.cache-hit != 'true'
778 run: |
779 cd extensions/vscode
780 npm run e2e:ci:download
781
782 - name: Upload e2e dependencies
783 uses: actions/upload-artifact@v4
784 with:
785 name: vscode-e2e-dependencies
786 path: extensions/vscode/e2e/storage
787
788 vscode-e2e-tests:
789 name: ${{ matrix.test_file || 'unknown' }} (${{ matrix.command }})
790 needs:
791 [
792 vscode-download-e2e-dependencies,
793 vscode-get-test-file-matrix,
794 vscode-package-extension,
795 install-vscode,
796 install-core,
797 install-config-yaml,
798 install-openai-adapters,
799 ]
800 runs-on: ubuntu-latest
801 # Tests requiring secrets need approval from maintainers
802 strategy:
803 fail-fast: false
804 matrix:
805 test_file: ${{ fromJson(needs.vscode-get-test-file-matrix.outputs.test_file_matrix) }}
806 command: ["e2e:ci:run", "e2e:ci:run-yaml"]
807 steps:
808 - uses: actions/checkout@v4
809
810 - uses: actions/setup-node@v4
811 with:
812 node-version-file: ".nvmrc"
813
814 - uses: actions/cache@v4
815 id: vscode-node-modules-cache
816 with:
817 path: extensions/vscode/node_modules
818 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
819
820 # We don't want to cache the Continue extension, so it is deleted at the end of the job
821 - uses: actions/cache@v4
822 id: test-extensions-cache
823 with:
824 path: extensions/vscode/e2e/.test-extensions
825 key: CONSTANT
826
827 - name: Download build artifact
828 uses: actions/download-artifact@v4
829 with:
830 name: vscode-extension-build-Linux
831 path: extensions/vscode/build
832
833 - name: Download e2e dependencies
834 uses: actions/download-artifact@v4
835 with:
836 name: vscode-e2e-dependencies
837 path: extensions/vscode/e2e/storage
838
839 - uses: actions/cache@v4
840 id: config-yaml-cache
841 with:
842 path: packages/config-yaml/node_modules
843 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
844
845 - uses: actions/cache@v4
846 id: openai-adapters-cache
847 with:
848 path: packages/openai-adapters/node_modules
849 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
850
851 - name: Build config-yaml
852 run: |
853 cd packages/config-yaml
854 npm run build
855
856 - name: Build openai-adapters
857 run: |
858 cd packages/openai-adapters
859 npm run build
860
861 - name: Fix VSCode binary permissions
862 run: |
863 chmod +x extensions/vscode/e2e/storage/VSCode-linux-x64/code
864 chmod +x extensions/vscode/e2e/storage/chromedriver-linux64/chromedriver
865
866 - name: Set up SSH
867 env:
868 SSH_KEY: ${{ secrets.GH_ACTIONS_SSH_TEST_KEY_PEM }}
869 SSH_HOST: ${{ secrets.GH_ACTIONS_SSH_TEST_DNS_NAME }}
870 run: |
871 mkdir -p ~/.ssh
872 echo "$SSH_KEY" > ~/.ssh/id_rsa
873 chmod 600 ~/.ssh/id_rsa
874 ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
875 echo -e "Host ssh-test-container\n\tHostName $SSH_HOST\n\tUser ec2-user\n\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
876 if: ${{ github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' }}
877
878 - name: Set up Xvfb
879 run: |
880 Xvfb :99 &
881 export DISPLAY=:99
882
883 - name: Run e2e tests
884 run: |
885 cd extensions/vscode
886 IGNORE_SSH_TESTS="${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }}" TEST_FILE="${{ matrix.test_file }}" npm run ${{ matrix.command }}
887 env:
888 DISPLAY: :99
889
890 - name: Delete continue from test extensions
891 run: |
892 cd extensions/vscode
893 rm -rf e2e/.test-extensions/continue*
894
895 - name: Sanitize test file name
896 id: sanitize_filename
897 if: always()
898 run: |
899 FILENAME="${{ matrix.test_file }}"
900 SANITIZED_FILENAME="${FILENAME//\//-}" # Replace / with - using bash parameter expansion
901 echo "sanitized_test_file=${SANITIZED_FILENAME}" >> $GITHUB_OUTPUT
902
903 - name: Upload e2e test screenshots
904 if: failure()
905 uses: actions/upload-artifact@v4
906 with:
907 name: e2e-failure-screenshots-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ matrix.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
908 path: extensions/vscode/e2e/storage/screenshots
909
910 - name: Find e2e log file
911 if: always()
912 run: |
913 echo "Searching for e2e.log file..."
914 find $GITHUB_WORKSPACE -name "e2e.log" -type f
915
916 - name: Upload e2e logs
917 if: always()
918 uses: actions/upload-artifact@v4
919 with:
920 name: e2e-logs-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ matrix.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
921 path: extensions/vscode/e2e.log
922
923 gui-tests:
924 needs:
925 [install-gui, install-core, install-config-yaml, install-openai-adapters]
926 runs-on: ubuntu-latest
927 steps:
928 - uses: actions/checkout@v4
929
930 - uses: actions/setup-node@v4
931 with:
932 node-version-file: ".nvmrc"
933
934 - uses: actions/cache@v4
935 id: gui-cache
936 with:
937 path: gui/node_modules
938 key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
939
940 - uses: actions/cache@v4
941 with:
942 path: core/node_modules
943 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
944
945 - uses: actions/cache@v4
946 id: config-yaml-cache
947 with:
948 path: packages/config-yaml/node_modules
949 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
950
951 - uses: actions/cache@v4
952 id: openai-adapters-cache
953 with:
954 path: packages/openai-adapters/node_modules
955 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
956
957 - name: Build config-yaml
958 run: |
959 cd packages/config-yaml
960 npm run build
961
962 - name: Build openai-adapters
963 run: |
964 cd packages/openai-adapters
965 npm run build
966
967 - name: Install GUI dependencies
968 if: steps.gui-cache.outputs.cache-hit != 'true'
969 run: cd gui && npm ci
970 env:
971 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
972
973 - name: Run gui tests
974 run: |
975 cd gui
976 npm test
977
978 jetbrains-tests:
979 needs:
980 [install-root, core-checks, install-config-yaml, install-openai-adapters]
981 runs-on: ubuntu-latest
982 steps:
983 - uses: actions/checkout@v4
984 - uses: actions/cache@v4
985 with:
986 path: core/node_modules
987 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
988
989 - uses: actions/cache@v4
990 id: config-yaml-cache
991 with:
992 path: packages/config-yaml/node_modules
993 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
994
995 - uses: actions/cache@v4
996 id: openai-adapters-cache
997 with:
998 path: packages/openai-adapters/node_modules
999 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
1000
1001 - name: Build config-yaml
1002 run: |
1003 cd packages/config-yaml
1004 npm run build
1005
1006 - name: Build openai-adapters
1007 run: |
1008 cd packages/openai-adapters
1009 npm run build
1010
1011 - name: Setup Java
1012 uses: actions/setup-java@v4.5.0
1013 with:
1014 distribution: zulu
1015 java-version: 17
1016
1017 - name: Setup FFmpeg
1018 uses: AnimMouse/setup-ffmpeg@v1
1019 with:
1020 token: ${{ secrets.GITHUB_TOKEN }}
1021
1022 - name: Setup Gradle
1023 uses: gradle/actions/setup-gradle@v3
1024
1025 - name: Use Node.js from .nvmrc
1026 uses: actions/setup-node@v4
1027 with:
1028 node-version-file: ".nvmrc"
1029
1030 - uses: actions/cache@v4
1031 id: gui-cache
1032 with:
1033 path: gui/node_modules
1034 key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
1035
1036 # We can shave off another minute off our CI script by finding a way to share this with vscode-tests
1037 - name: Run prepackage script
1038 run: |
1039 cd extensions/vscode
1040 npm ci
1041 npm run prepackage
1042 env:
1043 # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
1044 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
1045
1046 - uses: actions/cache@v4
1047 id: binary-cache
1048 with:
1049 path: binary/node_modules
1050 key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }}
1051
1052 - name: Build the binaries
1053 run: |
1054 cd binary
1055 npm run build
1056
1057 - name: Start test IDE
1058 run: |
1059 cd extensions/intellij
1060 export DISPLAY=:99.0
1061 Xvfb -ac :99 -screen 0 1920x1080x24 &
1062 sleep 10
1063 mkdir -p build/reports
1064 ./gradlew runIdeForUiTests &
1065
1066 - name: Wait for JB connection
1067 uses: jtalk/url-health-check-action@v3
1068 with:
1069 url: http://127.0.0.1:8082
1070 max-attempts: 15
1071 retry-delay: 30s
1072
1073 - name: Run tests
1074 run: |
1075 cd extensions/intellij
1076 export DISPLAY=:99.0
1077 ./gradlew test
1078
1079 - name: Move video
1080 if: ${{ failure() }}
1081 run: |
1082 cd extensions/intellij
1083 mv video build/reports
1084
1085 - name: Copy logs
1086 if: ${{ failure() }}
1087 run: |
1088 cd extensions/intellij
1089 mv build/idea-sandbox/system/log/ build/reports
1090
1091 - name: Save fails report
1092 if: ${{ failure() }}
1093 uses: actions/upload-artifact@v4
1094 with:
1095 name: jb-failure-report
1096 path: |
1097 ${{ github.workspace }}/extensions/intellij/build/reports
1098
1099 # GitHub does not have a way of requiring that all checks pass (you must manually select each job)
1100 # This action at least lets us manage the list of required tests via source control
1101 # so that creators of new jobs can add them to this list
1102 require-all-checks-to-pass:
1103 if: always()
1104 runs-on: ubuntu-latest
1105 needs:
1106 - install-root
1107 - prettier-check
1108 - install-core
1109 - core-checks
1110 - install-gui
1111 - gui-checks
1112 - binary-checks
1113 - install-vscode
1114 - vscode-checks
1115 - core-tests
1116 - package-tests
1117 - vscode-get-test-file-matrix
1118 - vscode-package-extension
1119 - vscode-download-e2e-dependencies
1120 - vscode-e2e-tests
1121 - gui-tests
1122 - jetbrains-tests
1123 - config-yaml-checks
1124 - install-config-yaml
1125 - install-openai-adapters
1126 - openai-adapters-tests
1127
1128 steps:
1129 - name: Decide whether the needed jobs succeeded or failed
1130 uses: re-actors/alls-green@release/v1
1131 with:
1132 jobs: ${{ toJSON(needs) }}