ci.yml 11.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:
15
    name: Hygiene and Layers check
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

51 52 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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 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 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
  # compile:
  #   name: Compile
  #   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
  #         key: cacheCompiledCode-${{ env.GITHUB_SHA }}

  #     - name: Compile Core
  #       run: yarn gulp compile-build

  #     - name: Compile Extensions
  #       run: yarn gulp compile-extensions-build

  #     - name: Minify VS Code
  #       run: yarn gulp minify-vscode

  # linux-build:
  #   name: Linux Build
  #   needs: 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
  #         key: cacheCompiledCode-${{ env.GITHUB_SHA }}

  #     - 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

  #     - name: Run Integration Tests (Electron)
  #       run: DISPLAY=:10 ./scripts/test-integration.sh --build
166

167
  linux:
168
    name: Linux
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
    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 已提交
190
        id: cacheNodeModules
191 192
        uses: actions/cache@v2
        with:
A
Alexandru Dima 已提交
193 194 195 196 197
          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
198 199 200
        uses: actions/cache@v2
        with:
          path: build/**/*.js
A
Alexandru Dima 已提交
201 202
          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 已提交
203
        if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' || steps.cacheBuildScripts.outputs.cache-hit != 'true' }}
204 205
        env:
          PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
A
Alexandru Dima 已提交
206
        run: yarn --frozen-lockfile
207

A
Alexandru Dima 已提交
208
      - name: Compile and Download
A
Alexandru Dima 已提交
209
        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"
210

A
Alexandru Dima 已提交
211 212
      - name: Run Unit Tests
        run: DISPLAY=:10 yarn concurrently --names "unit-tests-electron,unit-tests-browser,integration-tests-electron" "./scripts/test.sh" "yarn test-browser --browser chromium" "./scripts/test-integration.sh"
213

214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
  # windows:
  #   runs-on: windows-2016
  #   env:
  #     CHILD_CONCURRENCY: "1"
  #     GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  #   steps:
  #   - uses: actions/checkout@v1
  #   - uses: actions/setup-node@v1
  #     with:
  #       node-version: 10
  #   - uses: actions/setup-python@v1
  #     with:
  #       python-version: '2.x'
  #   - run: yarn --frozen-lockfile
  #     name: Install Dependencies
  #   - run: yarn electron
  #     name: Download Electron
  #   - run: yarn gulp hygiene
  #     name: Run Hygiene Checks
  #   - run: yarn monaco-compile-check
  #     name: Run Monaco Editor Checks
  #   - run: yarn valid-layers-check
  #     name: Run Valid Layers Checks
  #   - run: yarn compile
  #     name: Compile Sources
  #   - run: yarn download-builtin-extensions
  #     name: Download Built-in Extensions
  #   - run: .\scripts\test.bat --tfs "Unit Tests"
  #     name: Run Unit Tests (Electron)
  #   - run: yarn test-browser --browser chromium
  #     name: Run Unit Tests (Browser)
  #   - run: .\scripts\test-integration.bat --tfs "Integration Tests"
  #     name: Run Integration Tests (Electron)
E
Edward Thomson 已提交
247

248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
  # darwin:
  #   runs-on: macos-latest
  #   env:
  #     CHILD_CONCURRENCY: "1"
  #     GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  #   steps:
  #   - uses: actions/checkout@v1
  #   - uses: actions/setup-node@v1
  #     with:
  #       node-version: 10
  #   - run: yarn --frozen-lockfile
  #     name: Install Dependencies
  #   - run: yarn electron x64
  #     name: Download Electron
  #   - run: yarn gulp hygiene
  #     name: Run Hygiene Checks
  #   - run: yarn monaco-compile-check
  #     name: Run Monaco Editor Checks
  #   - run: yarn valid-layers-check
  #     name: Run Valid Layers Checks
  #   - run: yarn compile
  #     name: Compile Sources
  #   - run: yarn download-builtin-extensions
  #     name: Download Built-in Extensions
  #   - run: ./scripts/test.sh --tfs "Unit Tests"
  #     name: Run Unit Tests (Electron)
  #   - run: yarn test-browser --browser chromium --browser webkit
  #     name: Run Unit Tests (Browser)
  #   - run: ./scripts/test-integration.sh --tfs "Integration Tests"
  #     name: Run Integration Tests (Electron)
278 279

  monaco:
280
    name: Monaco Editor checks
281
    runs-on: ubuntu-latest
282 283 284
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
A
Alex Dima 已提交
285
      - uses: actions/checkout@v2
286

A
Alex Dima 已提交
287
      - uses: actions/setup-node@v2-beta
J
João Moreno 已提交
288
        with:
A
Alex Dima 已提交
289
          node-version: 12
290

291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
      - 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
309

310 311 312 313 314
      - name: Run Monaco Editor Checks
        run: yarn monaco-compile-check

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