Elffuss BraidHub

kikocis/continue public

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