Elffuss BraidHub

kikocis/continue public

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