From 2fb82fb3ad2bc4f7ec71979538575d887af7c27f Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 23 Nov 2021 09:31:51 +0100 Subject: [PATCH] Also run monaco-editor checks in nightly --- .github/workflows/ci.yml | 4 +- .github/workflows/nightly.yml | 64 ++++++++++++++++--- .../workflows/nightly/setNightlyVersion.js | 22 +++++++ .../nightly/useLocalMonacoEditorCore.js | 15 +++++ 4 files changed, 94 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/nightly/setNightlyVersion.js create mode 100644 .github/workflows/nightly/useLocalMonacoEditorCore.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00e35d28..f64468ba 100644 --- a/.github/workflows/ci.yml +++ b/.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 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index af60eab4..7d779997 100644 --- a/.github/workflows/nightly.yml +++ b/.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 diff --git a/.github/workflows/nightly/setNightlyVersion.js b/.github/workflows/nightly/setNightlyVersion.js new file mode 100644 index 00000000..cf5d2601 --- /dev/null +++ b/.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 `); + 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'); diff --git a/.github/workflows/nightly/useLocalMonacoEditorCore.js b/.github/workflows/nightly/useLocalMonacoEditorCore.js new file mode 100644 index 00000000..517cde5e --- /dev/null +++ b/.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');