Elffuss BraidHub

kikocis/continue public

0ebad2befb44 · 32.3 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 env:
617 # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
618 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
619
620 - name: Debug Outputs
621 run: |
622 echo "Test files: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}"
623
624 vscode-package-extension:
625 runs-on: ubuntu-latest
626 needs:
627 [
628 install-vscode,
629 install-core,
630 install-config-yaml,
631 install-openai-adapters,
632 ]
633 steps:
634 - uses: actions/checkout@v4
635
636 - uses: actions/setup-node@v4
637 with:
638 node-version-file: ".nvmrc"
639
640 - uses: actions/cache@v4
641 id: vscode-node-modules-cache
642 with:
643 path: extensions/vscode/node_modules
644 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
645
646 - uses: actions/cache@v4
647 id: core-node-modules-cache
648 with:
649 path: core/node_modules
650 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
651
652 - uses: actions/cache@v4
653 id: config-yaml-cache
654 with:
655 path: packages/config-yaml/node_modules
656 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
657
658 - uses: actions/cache@v4
659 id: openai-adapters-cache
660 with:
661 path: packages/openai-adapters/node_modules
662 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
663
664 - name: Build config-yaml
665 run: |
666 cd packages/config-yaml
667 npm run build
668
669 - name: Build openai-adapters
670 run: |
671 cd packages/openai-adapters
672 npm run build
673
674 - name: Package extension
675 run: |
676 cd extensions/vscode
677 npm run package
678
679 - name: Upload build artifact
680 uses: actions/upload-artifact@v4
681 with:
682 name: vscode-extension-build
683 path: extensions/vscode/build
684
685 vscode-download-e2e-dependencies:
686 runs-on: ubuntu-latest
687 needs:
688 [
689 install-vscode,
690 install-core,
691 install-config-yaml,
692 install-openai-adapters,
693 ]
694 steps:
695 - uses: actions/checkout@v4
696
697 - uses: actions/setup-node@v4
698 with:
699 node-version-file: ".nvmrc"
700
701 - uses: actions/cache@v4
702 id: vscode-node-modules-cache
703 with:
704 path: extensions/vscode/node_modules
705 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
706
707 - uses: actions/cache@v4
708 id: storage-cache
709 with:
710 path: extensions/vscode/e2e/storage
711 key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }}
712
713 - uses: actions/cache@v4
714 id: config-yaml-cache
715 with:
716 path: packages/config-yaml/node_modules
717 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
718
719 - name: Build config-yaml
720 run: |
721 cd packages/config-yaml
722 npm run build
723
724 - name: Download Dependencies
725 if: steps.storage-cache.outputs.cache-hit != 'true'
726 run: |
727 cd extensions/vscode
728 npm run e2e:ci:download
729
730 - name: Upload e2e dependencies
731 uses: actions/upload-artifact@v4
732 with:
733 name: vscode-e2e-dependencies
734 path: extensions/vscode/e2e/storage
735
736 vscode-e2e-tests:
737 name: ${{ matrix.test_file || 'unknown' }} (${{ matrix.command }})
738 needs:
739 [
740 vscode-download-e2e-dependencies,
741 vscode-get-test-file-matrix,
742 vscode-package-extension,
743 install-vscode,
744 install-core,
745 install-config-yaml,
746 install-openai-adapters,
747 ]
748 runs-on: ubuntu-latest
749 # Tests requiring secrets need approval from maintainers
750 strategy:
751 fail-fast: false
752 matrix:
753 test_file: ${{ fromJson(needs.vscode-get-test-file-matrix.outputs.test_file_matrix) }}
754 command: ["e2e:ci:run", "e2e:ci:run-yaml"]
755 steps:
756 - uses: actions/checkout@v4
757
758 - uses: actions/setup-node@v4
759 with:
760 node-version-file: ".nvmrc"
761
762 - uses: actions/cache@v4
763 id: vscode-node-modules-cache
764 with:
765 path: extensions/vscode/node_modules
766 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
767
768 # We don't want to cache the Continue extension, so it is deleted at the end of the job
769 - uses: actions/cache@v4
770 id: test-extensions-cache
771 with:
772 path: extensions/vscode/e2e/.test-extensions
773 key: CONSTANT
774
775 - name: Download build artifact
776 uses: actions/download-artifact@v4
777 with:
778 name: vscode-extension-build
779 path: extensions/vscode/build
780
781 - name: Download e2e dependencies
782 uses: actions/download-artifact@v4
783 with:
784 name: vscode-e2e-dependencies
785 path: extensions/vscode/e2e/storage
786
787 - uses: actions/cache@v4
788 id: config-yaml-cache
789 with:
790 path: packages/config-yaml/node_modules
791 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
792
793 - uses: actions/cache@v4
794 id: openai-adapters-cache
795 with:
796 path: packages/openai-adapters/node_modules
797 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
798
799 - name: Build config-yaml
800 run: |
801 cd packages/config-yaml
802 npm run build
803
804 - name: Build openai-adapters
805 run: |
806 cd packages/openai-adapters
807 npm run build
808
809 - name: Fix VSCode binary permissions
810 run: |
811 chmod +x extensions/vscode/e2e/storage/VSCode-linux-x64/code
812 chmod +x extensions/vscode/e2e/storage/chromedriver-linux64/chromedriver
813
814 - name: Set up SSH
815 env:
816 SSH_KEY: ${{ secrets.GH_ACTIONS_SSH_TEST_KEY_PEM }}
817 SSH_HOST: ${{ secrets.GH_ACTIONS_SSH_TEST_DNS_NAME }}
818 run: |
819 mkdir -p ~/.ssh
820 echo "$SSH_KEY" > ~/.ssh/id_rsa
821 chmod 600 ~/.ssh/id_rsa
822 ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
823 echo -e "Host ssh-test-container\n\tHostName $SSH_HOST\n\tUser ec2-user\n\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
824 if: ${{ github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' }}
825
826 - name: Set up Xvfb
827 run: |
828 Xvfb :99 &
829 export DISPLAY=:99
830
831 - name: Run e2e tests
832 run: |
833 cd extensions/vscode
834 IGNORE_SSH_TESTS="${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }}" TEST_FILE="${{ matrix.test_file }}" npm run ${{ matrix.command }}
835 env:
836 DISPLAY: :99
837
838 - name: Delete continue from test extensions
839 run: |
840 cd extensions/vscode
841 rm -rf e2e/.test-extensions/continue*
842
843 - name: Sanitize test file name
844 id: sanitize_filename
845 if: always()
846 run: |
847 FILENAME="${{ matrix.test_file }}"
848 SANITIZED_FILENAME="${FILENAME//\//-}" # Replace / with - using bash parameter expansion
849 echo "sanitized_test_file=${SANITIZED_FILENAME}" >> $GITHUB_OUTPUT
850
851 - name: Upload e2e test screenshots
852 if: failure()
853 uses: actions/upload-artifact@v4
854 with:
855 name: e2e-failure-screenshots-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ matrix.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
856 path: extensions/vscode/e2e/storage/screenshots
857
858 - name: Find e2e log file
859 if: always()
860 run: |
861 echo "Searching for e2e.log file..."
862 find $GITHUB_WORKSPACE -name "e2e.log" -type f
863
864 - name: Upload e2e logs
865 if: always()
866 uses: actions/upload-artifact@v4
867 with:
868 name: e2e-logs-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ matrix.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
869 path: extensions/vscode/e2e.log
870
871 gui-tests:
872 needs:
873 [install-gui, install-core, install-config-yaml, install-openai-adapters]
874 runs-on: ubuntu-latest
875 steps:
876 - uses: actions/checkout@v4
877
878 - uses: actions/setup-node@v4
879 with:
880 node-version-file: ".nvmrc"
881
882 - uses: actions/cache@v4
883 id: gui-cache
884 with:
885 path: gui/node_modules
886 key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
887
888 - uses: actions/cache@v4
889 with:
890 path: core/node_modules
891 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
892
893 - uses: actions/cache@v4
894 id: config-yaml-cache
895 with:
896 path: packages/config-yaml/node_modules
897 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
898
899 - uses: actions/cache@v4
900 id: openai-adapters-cache
901 with:
902 path: packages/openai-adapters/node_modules
903 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
904
905 - name: Build config-yaml
906 run: |
907 cd packages/config-yaml
908 npm run build
909
910 - name: Build openai-adapters
911 run: |
912 cd packages/openai-adapters
913 npm run build
914
915 - name: Install GUI dependencies
916 if: steps.gui-cache.outputs.cache-hit != 'true'
917 run: cd gui && npm ci
918 env:
919 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
920
921 - name: Run gui tests
922 run: |
923 cd gui
924 npm test
925
926 jetbrains-tests:
927 needs:
928 [install-root, core-checks, install-config-yaml, install-openai-adapters]
929 runs-on: ubuntu-latest
930 steps:
931 - uses: actions/checkout@v4
932 - uses: actions/cache@v4
933 with:
934 path: core/node_modules
935 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
936
937 - uses: actions/cache@v4
938 id: config-yaml-cache
939 with:
940 path: packages/config-yaml/node_modules
941 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
942
943 - uses: actions/cache@v4
944 id: openai-adapters-cache
945 with:
946 path: packages/openai-adapters/node_modules
947 key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
948
949 - name: Build config-yaml
950 run: |
951 cd packages/config-yaml
952 npm run build
953
954 - name: Build openai-adapters
955 run: |
956 cd packages/openai-adapters
957 npm run build
958
959 - name: Setup Java
960 uses: actions/setup-java@v4.5.0
961 with:
962 distribution: zulu
963 java-version: 17
964
965 - name: Setup FFmpeg
966 uses: AnimMouse/setup-ffmpeg@v1
967 with:
968 token: ${{ secrets.GITHUB_TOKEN }}
969
970 - name: Setup Gradle
971 uses: gradle/actions/setup-gradle@v3
972
973 - name: Use Node.js from .nvmrc
974 uses: actions/setup-node@v4
975 with:
976 node-version-file: ".nvmrc"
977
978 - uses: actions/cache@v4
979 id: gui-cache
980 with:
981 path: gui/node_modules
982 key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
983
984 # We can shave off another minute off our CI script by finding a way to share this with vscode-tests
985 - name: Run prepackage script
986 run: |
987 cd extensions/vscode
988 npm ci
989 npm run prepackage
990 env:
991 # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
992 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
993
994 - uses: actions/cache@v4
995 id: binary-cache
996 with:
997 path: binary/node_modules
998 key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }}
999
1000 - name: Build the binaries
1001 run: |
1002 cd binary
1003 npm run build
1004
1005 - name: Start test IDE
1006 run: |
1007 cd extensions/intellij
1008 export DISPLAY=:99.0
1009 Xvfb -ac :99 -screen 0 1920x1080x24 &
1010 sleep 10
1011 mkdir -p build/reports
1012 ./gradlew runIdeForUiTests &
1013
1014 - name: Wait for JB connection
1015 uses: jtalk/url-health-check-action@v3
1016 with:
1017 url: http://127.0.0.1:8082
1018 max-attempts: 15
1019 retry-delay: 30s
1020
1021 - name: Run tests
1022 run: |
1023 cd extensions/intellij
1024 export DISPLAY=:99.0
1025 ./gradlew test
1026
1027 - name: Move video
1028 if: ${{ failure() }}
1029 run: |
1030 cd extensions/intellij
1031 mv video build/reports
1032
1033 - name: Copy logs
1034 if: ${{ failure() }}
1035 run: |
1036 cd extensions/intellij
1037 mv build/idea-sandbox/system/log/ build/reports
1038
1039 - name: Save fails report
1040 if: ${{ failure() }}
1041 uses: actions/upload-artifact@v4
1042 with:
1043 name: jb-failure-report
1044 path: |
1045 ${{ github.workspace }}/extensions/intellij/build/reports
1046
1047 # GitHub does not have a way of requiring that all checks pass (you must manually select each job)
1048 # This action at least lets us manage the list of required tests via source control
1049 # so that creators of new jobs can add them to this list
1050 require-all-checks-to-pass:
1051 if: always()
1052 runs-on: ubuntu-latest
1053 needs:
1054 - install-root
1055 - prettier-check
1056 - install-core
1057 - core-checks
1058 - install-gui
1059 - gui-checks
1060 - binary-checks
1061 - install-vscode
1062 - vscode-checks
1063 - core-tests
1064 - package-tests
1065 - vscode-get-test-file-matrix
1066 - vscode-package-extension
1067 - vscode-download-e2e-dependencies
1068 - vscode-e2e-tests
1069 - gui-tests
1070 - jetbrains-tests
1071 - config-yaml-checks
1072 - install-config-yaml
1073 - install-openai-adapters
1074
1075 steps:
1076 - name: Decide whether the needed jobs succeeded or failed
1077 uses: re-actors/alls-green@release/v1
1078 with:
1079 jobs: ${{ toJSON(needs) }}