2022-06-14 14:37:10 +08:00
|
|
|
name: Monaco Editor checks
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- release/*
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- release/*
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
main:
|
|
|
|
name: Monaco Editor checks
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 40
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
steps:
|
2024-04-30 20:57:13 +08:00
|
|
|
- uses: actions/checkout@v4
|
2022-06-14 14:37:10 +08:00
|
|
|
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
2024-04-30 20:57:13 +08:00
|
|
|
node-version-file: .nvmrc
|
2022-06-14 14:37:10 +08:00
|
|
|
|
|
|
|
- name: Compute node modules cache key
|
|
|
|
id: nodeModulesCacheKey
|
2024-04-30 20:57:13 +08:00
|
|
|
run: echo "value=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js)" >> $GITHUB_OUTPUT
|
2022-06-14 14:37:10 +08:00
|
|
|
- name: Cache node modules
|
|
|
|
id: cacheNodeModules
|
2024-04-30 20:57:13 +08:00
|
|
|
uses: actions/cache@v3
|
2022-06-14 14:37:10 +08:00
|
|
|
with:
|
|
|
|
path: "**/node_modules"
|
|
|
|
key: ${{ runner.os }}-cacheNodeModules20-${{ steps.nodeModulesCacheKey.outputs.value }}
|
|
|
|
restore-keys: ${{ runner.os }}-cacheNodeModules20-
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarnCacheDirPath
|
|
|
|
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
2024-04-30 20:57:13 +08:00
|
|
|
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
2022-06-14 14:37:10 +08:00
|
|
|
- name: Cache yarn directory
|
|
|
|
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
2024-04-30 20:57:13 +08:00
|
|
|
uses: actions/cache@v3
|
2022-06-14 14:37:10 +08:00
|
|
|
with:
|
|
|
|
path: ${{ steps.yarnCacheDirPath.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }}
|
|
|
|
restore-keys: ${{ runner.os }}-yarnCacheDir-
|
2024-04-30 20:57:13 +08:00
|
|
|
- name: Install libkrb5-dev
|
|
|
|
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y libkrb5-dev
|
2022-06-14 14:37:10 +08:00
|
|
|
- name: Execute yarn
|
|
|
|
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
|
|
|
env:
|
|
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
|
|
|
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
|
2024-04-30 20:57:13 +08:00
|
|
|
run: |
|
|
|
|
npm i -g node-gyp@9.4.0
|
|
|
|
yarn --frozen-lockfile --network-timeout 180000
|
2022-06-14 14:37:10 +08:00
|
|
|
|
|
|
|
- name: Download Playwright
|
|
|
|
run: yarn playwright-install
|
|
|
|
|
|
|
|
- name: Run Monaco Editor Checks
|
|
|
|
run: yarn monaco-compile-check
|
|
|
|
|
2024-04-30 20:57:13 +08:00
|
|
|
- name: Editor Distro & ESM
|
|
|
|
run: yarn gulp editor-esm
|
2022-06-14 14:37:10 +08:00
|
|
|
|
|
|
|
- name: Editor ESM sources check
|
|
|
|
working-directory: ./test/monaco
|
|
|
|
run: yarn run esm-check
|
|
|
|
|
|
|
|
- name: Typings validation prep
|
|
|
|
run: |
|
|
|
|
mkdir typings-test
|
|
|
|
|
|
|
|
- name: Typings validation
|
|
|
|
working-directory: ./typings-test
|
|
|
|
run: |
|
|
|
|
yarn init -yp
|
|
|
|
../node_modules/.bin/tsc --init
|
|
|
|
echo "import '../out-monaco-editor-core';" > a.ts
|
|
|
|
../node_modules/.bin/tsc --noEmit
|
|
|
|
|
|
|
|
- name: Package Editor with Webpack
|
|
|
|
working-directory: ./test/monaco
|
|
|
|
run: yarn run bundle-webpack
|
|
|
|
|
|
|
|
- name: Compile Editor Tests
|
|
|
|
working-directory: ./test/monaco
|
|
|
|
run: yarn run compile
|
|
|
|
|
|
|
|
- name: Run Editor Tests
|
|
|
|
timeout-minutes: 5
|
|
|
|
working-directory: ./test/monaco
|
|
|
|
run: yarn test
|