Elffuss BraidHub

kikocis/continue public

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