Elffuss BraidHub

kikocis/continue public

d691089ac9f7 · 26.9 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 AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
439 AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
440
441 package-tests:
442 runs-on: ubuntu-latest
443 steps:
444 - uses: actions/checkout@v4
445
446 - uses: actions/setup-node@v4
447 with:
448 node-version-file: ".nvmrc"
449
450 - uses: actions/cache@v4
451 with:
452 path: core/node_modules
453 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
454
455 - name: Install dependencies
456 run: |
457 cd packages/config-yaml
458 npm ci
459
460 - name: Run config-yaml tests
461 run: |
462 cd packages/config-yaml
463 npm test
464
465 vscode-get-test-file-matrix:
466 runs-on: ubuntu-latest
467 needs: [install-root, install-vscode, install-config-yaml]
468 outputs:
469 test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}
470 steps:
471 - uses: actions/checkout@v4
472
473 - name: Cache node modules
474 uses: actions/cache@v3
475 with:
476 path: extensions/vscode/node_modules
477 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
478
479 - uses: actions/cache@v4
480 id: config-yaml-cache
481 with:
482 path: packages/config-yaml/node_modules
483 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
484
485 - name: Build config-yaml
486 run: |
487 cd packages/config-yaml
488 npm run build
489
490 - name: Get test files
491 id: vscode-get-test-file-matrix
492 run: |
493 cd extensions/vscode
494 npm ci
495 npm run e2e:compile
496 if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" || "${{ github.actor }}" == "dependabot[bot]" ]]; then
497 # Exclude SSH tests for forks
498 FILES=$(ls -1 e2e/_output/tests/*.test.js | grep -v "SSH" | jq -R . | jq -s .)
499 else
500 # Include all tests for non-forks
501 FILES=$(ls -1 e2e/_output/tests/*.test.js | jq -R . | jq -s .)
502 fi
503 echo "test_file_matrix<<EOF" >> $GITHUB_OUTPUT
504 echo "$FILES" >> $GITHUB_OUTPUT
505 echo "EOF" >> $GITHUB_OUTPUT
506
507 - name: Debug Outputs
508 run: |
509 echo "Test files: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}"
510
511 vscode-package-extension:
512 runs-on: ubuntu-latest
513 needs: [install-vscode, install-core, install-config-yaml]
514 steps:
515 - uses: actions/checkout@v4
516
517 - uses: actions/setup-node@v4
518 with:
519 node-version-file: ".nvmrc"
520
521 - uses: actions/cache@v4
522 id: vscode-node-modules-cache
523 with:
524 path: extensions/vscode/node_modules
525 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
526
527 - uses: actions/cache@v4
528 id: core-node-modules-cache
529 with:
530 path: core/node_modules
531 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
532
533 - uses: actions/cache@v4
534 id: config-yaml-cache
535 with:
536 path: packages/config-yaml/node_modules
537 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
538
539 - name: Build config-yaml
540 run: |
541 cd packages/config-yaml
542 npm run build
543
544 - name: Package extension
545 run: |
546 cd extensions/vscode
547 npm run package
548
549 - name: Upload build artifact
550 uses: actions/upload-artifact@v4
551 with:
552 name: vscode-extension-build
553 path: extensions/vscode/build
554
555 vscode-download-e2e-dependencies:
556 runs-on: ubuntu-latest
557 needs: [install-vscode, install-core, install-config-yaml]
558 steps:
559 - uses: actions/checkout@v4
560
561 - uses: actions/setup-node@v4
562 with:
563 node-version-file: ".nvmrc"
564
565 - uses: actions/cache@v4
566 id: vscode-node-modules-cache
567 with:
568 path: extensions/vscode/node_modules
569 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
570
571 - uses: actions/cache@v4
572 id: storage-cache
573 with:
574 path: extensions/vscode/e2e/storage
575 key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }}
576
577 - uses: actions/cache@v4
578 id: config-yaml-cache
579 with:
580 path: packages/config-yaml/node_modules
581 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
582
583 - name: Build config-yaml
584 run: |
585 cd packages/config-yaml
586 npm run build
587
588 - name: Download Dependencies
589 if: steps.storage-cache.outputs.cache-hit != 'true'
590 run: |
591 cd extensions/vscode
592 npm run e2e:ci:download
593
594 - name: Upload e2e dependencies
595 uses: actions/upload-artifact@v4
596 with:
597 name: vscode-e2e-dependencies
598 path: extensions/vscode/e2e/storage
599
600 vscode-e2e-tests:
601 name: ${{ matrix.test_file || 'unknown' }} (${{ matrix.command }})
602 needs:
603 [
604 vscode-download-e2e-dependencies,
605 vscode-get-test-file-matrix,
606 vscode-package-extension,
607 install-vscode,
608 install-core,
609 install-config-yaml,
610 ]
611 runs-on: ubuntu-latest
612 # Tests requiring secrets need approval from maintainers
613 strategy:
614 fail-fast: false
615 matrix:
616 test_file: ${{ fromJson(needs.vscode-get-test-file-matrix.outputs.test_file_matrix) }}
617 command: ["e2e:ci:run", "e2e:ci:run-yaml"]
618 steps:
619 - uses: actions/checkout@v4
620
621 - uses: actions/setup-node@v4
622 with:
623 node-version-file: ".nvmrc"
624
625 - uses: actions/cache@v4
626 id: vscode-node-modules-cache
627 with:
628 path: extensions/vscode/node_modules
629 key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
630
631 # We don't want to cache the Continue extension, so it is deleted at the end of the job
632 - uses: actions/cache@v4
633 id: test-extensions-cache
634 with:
635 path: extensions/vscode/e2e/.test-extensions
636 key: CONSTANT
637
638 - name: Download build artifact
639 uses: actions/download-artifact@v4
640 with:
641 name: vscode-extension-build
642 path: extensions/vscode/build
643
644 - name: Download e2e dependencies
645 uses: actions/download-artifact@v4
646 with:
647 name: vscode-e2e-dependencies
648 path: extensions/vscode/e2e/storage
649
650 - uses: actions/cache@v4
651 id: config-yaml-cache
652 with:
653 path: packages/config-yaml/node_modules
654 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
655
656 - name: Build config-yaml
657 run: |
658 cd packages/config-yaml
659 npm run build
660
661 - name: Fix VSCode binary permissions
662 run: |
663 chmod +x extensions/vscode/e2e/storage/VSCode-linux-x64/code
664 chmod +x extensions/vscode/e2e/storage/chromedriver-linux64/chromedriver
665
666 - name: Set up SSH
667 env:
668 SSH_KEY: ${{ secrets.GH_ACTIONS_SSH_TEST_KEY_PEM }}
669 SSH_HOST: ${{ secrets.GH_ACTIONS_SSH_TEST_DNS_NAME }}
670 run: |
671 mkdir -p ~/.ssh
672 echo "$SSH_KEY" > ~/.ssh/id_rsa
673 chmod 600 ~/.ssh/id_rsa
674 ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
675 echo -e "Host ssh-test-container\n\tHostName $SSH_HOST\n\tUser ec2-user\n\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
676 if: ${{ github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' }}
677
678 - name: Set up Xvfb
679 run: |
680 Xvfb :99 &
681 export DISPLAY=:99
682
683 - name: Run e2e tests
684 run: |
685 cd extensions/vscode
686 IGNORE_SSH_TESTS="${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }}" TEST_FILE="${{ matrix.test_file }}" npm run ${{ matrix.command }}
687 env:
688 DISPLAY: :99
689
690 - name: Delete continue from test extensions
691 run: |
692 cd extensions/vscode
693 rm -rf e2e/.test-extensions/continue*
694
695 - name: Sanitize test file name
696 id: sanitize_filename
697 if: always()
698 run: |
699 FILENAME="${{ matrix.test_file }}"
700 SANITIZED_FILENAME="${FILENAME//\//-}" # Replace / with - using bash parameter expansion
701 echo "sanitized_test_file=${SANITIZED_FILENAME}" >> $GITHUB_OUTPUT
702
703 - name: Upload e2e test screenshots
704 if: failure()
705 uses: actions/upload-artifact@v4
706 with:
707 name: e2e-failure-screenshots-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ matrix.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
708 path: extensions/vscode/e2e/storage/screenshots
709
710 - name: Find e2e log file
711 if: always()
712 run: |
713 echo "Searching for e2e.log file..."
714 find $GITHUB_WORKSPACE -name "e2e.log" -type f
715
716 - name: Upload e2e logs
717 if: always()
718 uses: actions/upload-artifact@v4
719 with:
720 name: e2e-logs-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ matrix.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
721 path: extensions/vscode/e2e.log
722
723 gui-tests:
724 needs: [install-gui, install-core, install-config-yaml]
725 runs-on: ubuntu-latest
726 steps:
727 - uses: actions/checkout@v4
728
729 - uses: actions/setup-node@v4
730 with:
731 node-version-file: ".nvmrc"
732
733 - uses: actions/cache@v4
734 id: gui-cache
735 with:
736 path: gui/node_modules
737 key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
738
739 - uses: actions/cache@v4
740 with:
741 path: core/node_modules
742 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
743
744 - uses: actions/cache@v4
745 id: config-yaml-cache
746 with:
747 path: packages/config-yaml/node_modules
748 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
749
750 - name: Build config-yaml
751 run: |
752 cd packages/config-yaml
753 npm run build
754
755 - name: Install GUI dependencies
756 if: steps.gui-cache.outputs.cache-hit != 'true'
757 run: cd gui && npm ci
758 env:
759 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
760
761 - name: Run gui tests
762 run: |
763 cd gui
764 npm test
765
766 jetbrains-tests:
767 needs: [install-root, core-checks, install-config-yaml]
768 runs-on: ubuntu-latest
769 steps:
770 - uses: actions/checkout@v4
771 - uses: actions/cache@v4
772 with:
773 path: core/node_modules
774 key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
775
776 - uses: actions/cache@v4
777 id: config-yaml-cache
778 with:
779 path: packages/config-yaml/node_modules
780 key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
781
782 - name: Build config-yaml
783 run: |
784 cd packages/config-yaml
785 npm run build
786
787 - name: Setup Java
788 uses: actions/setup-java@v4.5.0
789 with:
790 distribution: zulu
791 java-version: 17
792
793 - name: Setup FFmpeg
794 uses: AnimMouse/setup-ffmpeg@v1
795 with:
796 token: ${{ secrets.GITHUB_TOKEN }}
797
798 - name: Setup Gradle
799 uses: gradle/actions/setup-gradle@v3
800
801 - name: Use Node.js from .nvmrc
802 uses: actions/setup-node@v4
803 with:
804 node-version-file: ".nvmrc"
805
806 - uses: actions/cache@v4
807 id: gui-cache
808 with:
809 path: gui/node_modules
810 key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
811
812 # We can shave off another minute off our CI script by finding a way to share this with vscode-tests
813 - name: Run prepackage script
814 run: |
815 cd extensions/vscode
816 npm ci
817 npm run prepackage
818 env:
819 # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
820 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
821
822 - uses: actions/cache@v4
823 id: binary-cache
824 with:
825 path: binary/node_modules
826 key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }}
827
828 - name: Build the binaries
829 run: |
830 cd binary
831 npm run build
832
833 - name: Start test IDE
834 run: |
835 cd extensions/intellij
836 export DISPLAY=:99.0
837 Xvfb -ac :99 -screen 0 1920x1080x24 &
838 sleep 10
839 mkdir -p build/reports
840 ./gradlew runIdeForUiTests &
841
842 - name: Wait for JB connection
843 uses: jtalk/url-health-check-action@v3
844 with:
845 url: http://127.0.0.1:8082
846 max-attempts: 15
847 retry-delay: 30s
848
849 - name: Run tests
850 run: |
851 cd extensions/intellij
852 export DISPLAY=:99.0
853 ./gradlew test
854
855 - name: Move video
856 if: ${{ failure() }}
857 run: |
858 cd extensions/intellij
859 mv video build/reports
860
861 - name: Copy logs
862 if: ${{ failure() }}
863 run: |
864 cd extensions/intellij
865 mv build/idea-sandbox/system/log/ build/reports
866
867 - name: Save fails report
868 if: ${{ failure() }}
869 uses: actions/upload-artifact@v4
870 with:
871 name: jb-failure-report
872 path: |
873 ${{ github.workspace }}/extensions/intellij/build/reports
874
875 # GitHub does not have a way of requiring that all checks pass (you must manually select each job)
876 # This action at least lets us manage the list of required tests via source control
877 # so that creators of new jobs can add them to this list
878 require-all-checks-to-pass:
879 if: always()
880 runs-on: ubuntu-latest
881 needs:
882 - install-root
883 - prettier-check
884 - install-core
885 - core-checks
886 - install-gui
887 - gui-checks
888 - binary-checks
889 - install-vscode
890 - vscode-checks
891 - core-tests
892 - package-tests
893 - vscode-get-test-file-matrix
894 - vscode-package-extension
895 - vscode-download-e2e-dependencies
896 - vscode-e2e-tests
897 - gui-tests
898 - jetbrains-tests
899 - config-yaml-checks
900 - install-config-yaml
901
902 steps:
903 - name: Decide whether the needed jobs succeeded or failed
904 uses: re-actors/alls-green@release/v1
905 with:
906 jobs: ${{ toJSON(needs) }}