Pārlūkot izejas kodu

Also run monaco-editor checks in nightly

Alex Dima 3 gadi atpakaļ
vecāks
revīzija
2fb82fb3ad

+ 2 - 2
.github/workflows/ci.yml

@@ -21,11 +21,11 @@ jobs:
           key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('**/package-lock.json') }}
           restore-keys: ${{ runner.os }}-cacheNodeModules-
 
-      - name: Install node modules (1)
+      - name: execute `npm ci` (1)
         if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
         run: npm ci
 
-      - name: Install node modules (2)
+      - name: execute `npm ci` (2)
         if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
         run: npm ci --prefix webpack-plugin
 

+ 55 - 9
.github/workflows/nightly.yml

@@ -14,15 +14,6 @@ jobs:
         with:
           node-version: 14
 
-      - uses: actions/checkout@v2
-        with:
-          repository: 'microsoft/monaco-editor'
-          path: './monaco-editor'
-
-      - name: Install node modules (1)
-        working-directory: './monaco-editor'
-        run: npm ci
-
       - name: (vscode) checkout
         uses: actions/checkout@v2
         with:
@@ -61,6 +52,9 @@ jobs:
         working-directory: './vscode'
         run: yarn test-browser --browser chromium
 
+      - name: (vscode) Patch package.json version
+        run: node ./monaco-editor/.github/workflows/nightly/setNightlyVersion.js ./vscode/build/monaco/package.json
+
       - name: (vscode) Editor Distro & ESM Bundle
         working-directory: './vscode'
         run: yarn gulp editor-esm-bundle
@@ -93,3 +87,55 @@ jobs:
         timeout-minutes: 5
         working-directory: ./vscode/test/monaco
         run: yarn test
+
+      - name: (monaco-editor) checkout
+        uses: actions/checkout@v2
+        with:
+          repository: 'microsoft/monaco-editor'
+          path: './monaco-editor'
+
+      - name: (monaco-editor) Patch package.json version
+        run: node ./monaco-editor/.github/workflows/nightly/setNightlyVersion.js ./monaco-editor/package.json
+
+      - name: (monaco-editor) Use local monaco-editor-core
+        run: node ./monaco-editor/.github/workflows/nightly/useLocalMonacoEditorCore.js
+
+      - name: (monaco-editor) execute `npm ci` (1)
+        working-directory: './monaco-editor'
+        run: npm ci
+
+      - name: (monaco-editor) execute `npm ci` (2)
+        working-directory: './monaco-editor/webpack-plugin'
+        run: npm ci
+
+      - name: (monaco-editor) Install OS Dependencies for Playwright
+        working-directory: './monaco-editor'
+        run: sudo npm run playwright-install-deps
+
+      - name: (monaco-editor) Check prettier
+        working-directory: './monaco-editor'
+        run: npm run prettier-check
+
+      - name: (monaco-editor) Build
+        working-directory: './monaco-editor'
+        run: npm run release
+
+      - name: (monaco-editor) Run unit tests
+        working-directory: './monaco-editor'
+        run: npm test
+
+      - name: (monaco-editor) Compile webpack plugin
+        working-directory: './monaco-editor'
+        run: npm run compile --prefix webpack-plugin
+
+      - name: (monaco-editor) Package using webpack plugin
+        working-directory: './monaco-editor'
+        run: npm run smoketest --prefix webpack-plugin
+
+      - name: (monaco-editor) Run smoke test
+        working-directory: './monaco-editor'
+        run: npm run smoketest
+
+      - name: (monaco-editor) Build website
+        working-directory: './monaco-editor'
+        run: npm run build-website

+ 22 - 0
.github/workflows/nightly/setNightlyVersion.js

@@ -0,0 +1,22 @@
+/*---------------------------------------------------------------------------------------------
+ *  Copyright (c) Microsoft Corporation. All rights reserved.
+ *  Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+//@ts-check
+
+const fs = require('fs');
+
+if (process.argv.length !== 3) {
+	console.error(`usage: node updateVersion.js <PATH_TO_PACKAGE_JSON_FILE>`);
+	process.exit(1);
+}
+
+const packagejson = JSON.parse(fs.readFileSync(process.argv[2]).toString());
+
+const date = new Date();
+packagejson.version += `-dev.${date.getUTCFullYear()}${String(date.getUTCMonth() + 1).padStart(
+	2,
+	'0'
+)}${String(date.getUTCDate()).padStart(2, '0')}`;
+fs.writeFileSync(process.argv[2], JSON.stringify(packagejson, null, '\t') + '\n');

+ 15 - 0
.github/workflows/nightly/useLocalMonacoEditorCore.js

@@ -0,0 +1,15 @@
+/*---------------------------------------------------------------------------------------------
+ *  Copyright (c) Microsoft Corporation. All rights reserved.
+ *  Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+//@ts-check
+
+const fs = require('fs');
+const path = require('path');
+
+const REPO_ROOT = path.join(__dirname, '../../../');
+const packagejsonPath = path.join(REPO_ROOT, 'package.json');
+const packagejson = JSON.parse(fs.readFileSync(packagejsonPath).toString());
+packagejson['devDependencies']['monaco-editor-core'] = 'file:../vscode/out-monaco-editor-core';
+fs.writeFileSync(packagejsonPath, JSON.stringify(packagejson, null, '\t') + '\n');