Extract cached yarn logic to a separate file

This commit is contained in:
Alexandru Dima
2020-12-11 21:27:08 +01:00
parent 01ea0ecc09
commit 623440c55c
2 changed files with 26 additions and 20 deletions

View File

@@ -189,26 +189,8 @@ jobs:
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: Cached yarn
uses: ./ci/cached-yarn
- name: Run Monaco Editor Checks
run: yarn monaco-compile-check

24
.github/workflows/ci/cached-yarn.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Cached yarn
runs:
using: composite
steps:
- 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