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