Add node module caching

pull/2455/head
Alexandru Dima 2020-12-28 16:55:20 +01:00
parent 1c659e7dc9
commit b08878cbb3
No known key found for this signature in database
GPG Key ID: 6E58D7B045760DA0
1 changed files with 50 additions and 7 deletions

View File

@ -11,25 +11,64 @@ on:
jobs:
build:
name: Smoke Test
# This job runs on Linux
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: microsoft/playwright-github-action@v1
- name: Set up Node.js
uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 10.x
node-version: 12
- name: Checkout VS Code
run: git clone --depth 1 https://github.com/microsoft/vscode vscode
- name: VS Code yarn & Editor Distro
- name: Compute VS Code node modules cache key
id: nodeModulesCacheKey
working-directory: ./vscode
run: echo "::set-output name=value::$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js)"
- name: Cache VS Code node modules
id: cacheNodeModules
uses: actions/cache@v2
with:
path: "vscode/**/node_modules"
key: ${{ runner.os }}-cacheNodeModules-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModules-
- name: Get yarn cache directory path
id: yarnCacheDirPath
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn directory
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
uses: actions/cache@v2
with:
path: ${{ steps.yarnCacheDirPath.outputs.dir }}
key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-yarnCacheDir-
- name: Execute yarn
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
working-directory: ./vscode
run: yarn --frozen-lockfile --network-timeout 180000
- name: Editor Distro
working-directory: ./vscode
run: |
yarn
yarn gulp editor-distro
- name: Typings validation prep
run: |
mkdir typings-test
- name: Typings validation
working-directory: ./typings-test
run: |
@ -38,13 +77,17 @@ jobs:
yarn tsc --init
echo "import '../vscode/out-monaco-editor-core';" > a.ts
yarn tsc --noEmit
- name: NPM Install
run: npm install
- name: Webpack Bundle
run: |
npm run bundle
- name: Build Tests
run: npm run build-test
- name: Run Smoke Test
run: |
npm run ciserver &