ci.yml 21.0 KB
Newer Older
E
Edward Thomson 已提交
1 2
name: CI

J
João Moreno 已提交
3 4
on:
  push:
5 6 7 8 9 10 11
    branches:
      - master
      - release/*
  pull_request:
    branches:
      - master
      - release/*
E
Edward Thomson 已提交
12 13

jobs:
14
  hygiene:
A
Alexandru Dima 已提交
15
    name: Hygiene and Layering
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - name: Cache node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-
      - name: Cache /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}
      - name: Execute yarn
40 41 42
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
43 44 45 46 47
        run: yarn --frozen-lockfile

      - name: Run Hygiene Checks
        run: yarn gulp hygiene

48 49 50
      - name: Run Valid Layers Checks
        run: yarn valid-layers-check

A
Alexandru Dima 已提交
51 52
  build-compile:
    name: "Build: Compile"
A
Alexandru Dima 已提交
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - name: Cache node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-
      - name: Cache /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}
      - name: Execute yarn
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
        run: yarn --frozen-lockfile

      - name: Cache compiled code
        id: cacheCompiledCode
        uses: actions/cache@v2
        with:
          path: |
            .build
            out-build
            out-vscode-min
A
Alexandru Dima 已提交
90
          key: cacheCompiledCode-${{ github.sha }}
A
Alexandru Dima 已提交
91 92

      - name: Compile Core
93
        if: ${{ steps.cacheCompiledCode.outputs.cache-hit != 'true' }}
A
Alexandru Dima 已提交
94 95 96
        run: yarn gulp compile-build

      - name: Compile Extensions
97
        if: ${{ steps.cacheCompiledCode.outputs.cache-hit != 'true' }}
A
Alexandru Dima 已提交
98 99 100
        run: yarn gulp compile-extensions-build

      - name: Minify VS Code
101
        if: ${{ steps.cacheCompiledCode.outputs.cache-hit != 'true' }}
A
Alexandru Dima 已提交
102 103
        run: yarn gulp minify-vscode

A
Alexandru Dima 已提交
104 105 106
  build-linux-unit-tests:
    name: "Build: Linux Unit Tests"
    needs: build-compile
A
Alexandru Dima 已提交
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      # TODO: rename azure-pipelines/linux/xvfb.init to github-actions
      - name: Setup Build Environment
        run: |
          sudo apt-get update
          sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
          sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
          sudo chmod +x /etc/init.d/xvfb
          sudo update-rc.d xvfb defaults
          sudo service xvfb start

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - name: Restore cached node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-

      - name: Restore cached /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}

      - name: Restore cached compiled code
        id: cacheCompiledCode
        uses: actions/cache@v2
        with:
          path: |
            .build
            out-build
            out-vscode-min
A
Alexandru Dima 已提交
150
          key: cacheCompiledCode-${{ github.sha }}
A
Alexandru Dima 已提交
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166

      - name: Build VS Code
        run: yarn gulp vscode-linux-x64-min-ci

      - name: Download Electron
        run: yarn electron x64

      - name: Run Unit Tests (Electron)
        run: DISPLAY=:10 ./scripts/test.sh --build

      - name: Download Playwright
        run: node ./node_modules/playwright/install.js

      - name: Run Unit Tests (Browser)
        run: DISPLAY=:10 yarn test-browser --build --browser chromium

A
Alexandru Dima 已提交
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
  build-linux-integration-tests:
    name: "Build: Linux Integration Tests"
    needs: build-compile
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      # TODO: rename azure-pipelines/linux/xvfb.init to github-actions
      - name: Setup Build Environment
        run: |
          sudo apt-get update
          sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
          sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
          sudo chmod +x /etc/init.d/xvfb
          sudo update-rc.d xvfb defaults
          sudo service xvfb start

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - name: Restore cached node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-

      - name: Restore cached /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}

      - name: Restore cached compiled code
        id: cacheCompiledCode
        uses: actions/cache@v2
        with:
          path: |
            .build
            out-build
            out-vscode-min
A
Alexandru Dima 已提交
213
          key: cacheCompiledCode-${{ github.sha }}
A
Alexandru Dima 已提交
214 215 216 217 218 219 220

      - name: Build VS Code
        run: yarn gulp vscode-linux-x64-min-ci

      - name: Download Electron
        run: yarn electron x64

A
Alexandru Dima 已提交
221 222
      - name: Run Integration Tests (Electron)
        run: DISPLAY=:10 ./scripts/test-integration.sh --build
223

A
Alexandru Dima 已提交
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
  build-darwin-unit-tests:
    name: "Build: macOS Unit Tests"
    needs: build-compile
    runs-on: macos-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - name: Cache node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-
      - name: Cache /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}
      - name: Execute yarn
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
        run: yarn --frozen-lockfile

      - name: Restore cached compiled code
        id: cacheCompiledCode
        uses: actions/cache@v2
        with:
          path: |
            .build
            out-build
            out-vscode-min
A
Alexandru Dima 已提交
264
          key: cacheCompiledCode-${{ github.sha }}
A
Alexandru Dima 已提交
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320

      - name: Build VS Code
        run: yarn gulp vscode-darwin-x64-min-ci

      - name: Download Electron
        run: yarn electron x64

      - name: Run Unit Tests (Electron)
        run: ./scripts/test.sh --build

      - name: Download Playwright
        run: node ./node_modules/playwright/install.js

      - name: Run Unit Tests (Browser)
        run: yarn test-browser --build --browser chromium --browser webkit --browser firefox

  build-darwin-integration-tests:
    name: "Build: macOS Integration Tests"
    needs: build-compile
    runs-on: macos-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - name: Cache node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-
      - name: Cache /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}
      - name: Execute yarn
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
        run: yarn --frozen-lockfile

      - name: Restore cached compiled code
        id: cacheCompiledCode
        uses: actions/cache@v2
        with:
          path: |
            .build
            out-build
            out-vscode-min
A
Alexandru Dima 已提交
321
          key: cacheCompiledCode-${{ github.sha }}
A
Alexandru Dima 已提交
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371

      - name: Build VS Code
        run: yarn gulp vscode-darwin-x64-min-ci

      - name: Download Electron
        run: yarn electron x64

      - name: Run Integration Tests (Electron)
        run: ./scripts/test-integration.sh --build

  build-darwin-smoke-tests:
    name: "Build: macOS Smoke Tests"
    needs: build-compile
    runs-on: macos-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - name: Cache node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-
      - name: Cache /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}
      - name: Execute yarn
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
        run: yarn --frozen-lockfile

      - name: Restore cached compiled code
        id: cacheCompiledCode
        uses: actions/cache@v2
        with:
          path: |
            .build
            out-build
            out-vscode-min
A
Alexandru Dima 已提交
372
          key: cacheCompiledCode-${{ github.sha }}
A
Alexandru Dima 已提交
373 374 375 376 377 378 379 380 381 382 383 384

      - name: Build VS Code
        run: yarn gulp vscode-darwin-x64-min-ci

      - name: Run Smoke Tests (Electron)
        continue-on-error: true
        run: |
          set -e
          APP_ROOT=$(GITHUB_WORKSPACE)/VSCode-darwin-x64
          APP_NAME="`ls $APP_ROOT | head -n 1`"
          yarn smoketest --build "$APP_ROOT/$APP_NAME"

385
  linux:
386
    name: Linux
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      # TODO: rename azure-pipelines/linux/xvfb.init to github-actions
      - name: Setup Build Environment
        run: |
          sudo apt-get update
          sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
          sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
          sudo chmod +x /etc/init.d/xvfb
          sudo update-rc.d xvfb defaults
          sudo service xvfb start

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - name: Cache node modules
A
Alexandru Dima 已提交
408
        id: cacheNodeModules
409 410
        uses: actions/cache@v2
        with:
A
Alexandru Dima 已提交
411 412 413 414 415
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-
      - name: Cache /build/ scripts
        id: cacheBuildScripts
416 417 418
        uses: actions/cache@v2
        with:
          path: build/**/*.js
A
Alexandru Dima 已提交
419 420
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}
      - name: Execute yarn
A
Alexandru Dima 已提交
421
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
422 423
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
A
Alexandru Dima 已提交
424
        run: yarn --frozen-lockfile
425

A
Alexandru Dima 已提交
426
      - name: Compile and Download
A
Alexandru Dima 已提交
427
        run: yarn concurrently --max_old_space_size=4095 --names "compile,electron,playwright,builtin-extensions" "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile" "yarn electron x64" "node ./node_modules/playwright/install.js" "yarn download-builtin-extensions"
428

A
Alexandru Dima 已提交
429
      - name: Run Unit Tests (Electron)
A
Alexandru Dima 已提交
430
        id: electron-unit-tests
A
Alexandru Dima 已提交
431
        run: DISPLAY=:10 ./scripts/test.sh
432

A
Alexandru Dima 已提交
433
      - name: Run Unit Tests (Browser)
A
Alexandru Dima 已提交
434
        id: browser-unit-tests
A
Alexandru Dima 已提交
435 436 437
        run: DISPLAY=:10 yarn test-browser --browser chromium

      - name: Run Integration Tests (Electron)
A
Alexandru Dima 已提交
438
        id: electron-integration-tests
A
Alexandru Dima 已提交
439 440
        run: DISPLAY=:10 ./scripts/test-integration.sh

A
Alexandru Dima 已提交
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460
      - name: Create Issue on Unit Test Failure
        uses: nashmaniac/create-issue-action@v1.1
        if: ${{ steps.electron-unit-tests.outputs.status == 'failure' || steps.browser-unit-tests.outputs.status == 'failure' }}
        with:
          title: Unit Test Failed
          token: ${{secrets.GITHUB_TOKEN}}
          assignees: ${{github.actor}}
          labels: unit-test-failure
          body: Running unit tests failed for commit ${{github.sha}}. Please see https://github.com/microsoft/vscode/runs/${{GITHUB_RUN_ID}}

      - name: Create Issue on Integration Test Failure
        uses: nashmaniac/create-issue-action@v1.1
        if: ${{ steps.electron-integration-tests.outputs.status == 'failure' && steps.electron-unit-tests.outputs.status != 'failure' && steps.browser-unit-tests.outputs.status != 'failure' }}
        with:
          title: Integration Test Failed
          token: ${{secrets.GITHUB_TOKEN}}
          assignees: ${{github.actor}}
          labels: integration-test-failure
          body: Running integration tests failed for commit ${{github.sha}}. Please see https://github.com/microsoft/vscode/runs/${{GITHUB_RUN_ID}}

A
Alexandru Dima 已提交
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507
  windows:
    name: Windows
    runs-on: windows-latest
    env:
      CHILD_CONCURRENCY: "1"
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - uses: actions/setup-python@v2
        with:
          python-version: '2.x'

      - name: Cache node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-
      - name: Cache /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}
      - name: Execute yarn
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
        run: yarn --frozen-lockfile

      - name: Compile and Download
        run: yarn concurrently --max_old_space_size=4095 --names "compile,electron,playwright,builtin-extensions" "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile" "yarn electron x64" "node ./node_modules/playwright/install.js" "yarn download-builtin-extensions"

      - name: Run Unit Tests (Electron)
        run: .\scripts\test.bat

      - name: Run Unit Tests (Browser)
        run: yarn test-browser --browser chromium

      - name: Run Integration Tests (Electron)
        run: .\scripts\test-integration.bat
E
Edward Thomson 已提交
508

A
Alexandru Dima 已提交
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542
  darwin:
    name: macOS
    runs-on: macos-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v2-beta
        with:
          node-version: 12

      - name: Cache node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-
      - name: Cache /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}
      - name: Execute yarn
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
        run: yarn --frozen-lockfile

      - name: Compile and Download
        run: yarn concurrently --max_old_space_size=4095 --names "compile,electron,playwright,builtin-extensions" "yarn compile" "yarn electron x64" "node ./node_modules/playwright/install.js" "yarn download-builtin-extensions"

A
Alexandru Dima 已提交
543 544 545 546 547 548 549 550
      - name: Run Unit Tests (Electron)
        run: DISPLAY=:10 ./scripts/test.sh

      - name: Run Unit Tests (Browser)
        run: DISPLAY=:10 yarn test-browser --browser chromium

      - name: Run Integration Tests (Electron)
        run: DISPLAY=:10 ./scripts/test-integration.sh
551 552

  monaco:
A
Alexandru Dima 已提交
553
    name: Monaco Editor
554
    runs-on: ubuntu-latest
555 556 557
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
A
Alex Dima 已提交
558
      - uses: actions/checkout@v2
559

A
Alex Dima 已提交
560
      - uses: actions/setup-node@v2-beta
J
João Moreno 已提交
561
        with:
A
Alex Dima 已提交
562
          node-version: 12
563

564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581
      - name: Cache node modules
        id: cacheNodeModules
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('.yarnrc', 'remote/.yarnrc', '**/yarn.lock', '!**/node_modules/**/yarn.lock', '!**/.*/**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-cacheNodeModules-
      - name: Cache /build/ scripts
        id: cacheBuildScripts
        uses: actions/cache@v2
        with:
          path: build/**/*.js
          key: ${{ runner.os }}-cacheBuildScripts-${{ hashFiles('build/yarn.lock', 'build/tsconfig.json', 'build/tsconfig.build.json', 'build/**/*.ts', '!**/node_modules/**/*.ts') }}
      - name: Execute yarn
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
        run: yarn --frozen-lockfile
582

583 584 585 586 587
      - name: Run Monaco Editor Checks
        run: yarn monaco-compile-check

      - name: Editor Distro & ESM Bundle
        run: yarn gulp editor-esm-bundle