mirror of https://github.com/embarklabs/embark.git
ci: activate caching of yarn packages in azure pipelines
See: https://docs.microsoft.com/en-us/azure/devops/pipelines/caching/?view=azure-devops#nodejsyarn
This commit is contained in:
parent
3416b051d0
commit
70115a20e0
|
@ -1,4 +1,5 @@
|
||||||
variables:
|
variables:
|
||||||
|
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
|
||||||
ipfsVersion: '0.4.22'
|
ipfsVersion: '0.4.22'
|
||||||
node10: '^10.17.0'
|
node10: '^10.17.0'
|
||||||
pythonVersion: '2.7.x'
|
pythonVersion: '2.7.x'
|
||||||
|
@ -72,12 +73,21 @@ steps:
|
||||||
condition: succeeded()
|
condition: succeeded()
|
||||||
displayName: 'Install Yarn'
|
displayName: 'Install Yarn'
|
||||||
|
|
||||||
|
- task: Cache@2
|
||||||
|
inputs:
|
||||||
|
key: 'yarn | "$(Agent.OS)" | yarn.lock'
|
||||||
|
restoreKeys: |
|
||||||
|
yarn | "$(Agent.OS)"
|
||||||
|
yarn
|
||||||
|
path: $(YARN_CACHE_FOLDER)
|
||||||
|
displayName: 'Cache Yarn packages'
|
||||||
|
|
||||||
- bash: |
|
- bash: |
|
||||||
pushd "$PWD" &>/dev/null
|
pushd "$PWD" &>/dev/null
|
||||||
cd ../Downloads
|
cd ../Downloads
|
||||||
export PATH="${PWD}/go-ipfs:${PATH}"
|
export PATH="${PWD}/go-ipfs:${PATH}"
|
||||||
export PATH="${HOME}/.yarn/bin:${HOME}/.config/yarn/global/node_modules/.bin:${PATH}"
|
export PATH="${HOME}/.yarn/bin:${HOME}/.config/yarn/global/node_modules/.bin:${PATH}"
|
||||||
yarn config set cache-folder "${PWD}/Yarn" &>/dev/null
|
yarn config set cache-folder "${YARN_CACHE_FOLDER}" &>/dev/null
|
||||||
popd &>/dev/null
|
popd &>/dev/null
|
||||||
npm run ci:full
|
npm run ci:full
|
||||||
condition: and( succeeded(), ne( variables['Agent.OS'], 'Windows_NT' ) )
|
condition: and( succeeded(), ne( variables['Agent.OS'], 'Windows_NT' ) )
|
||||||
|
@ -88,7 +98,7 @@ steps:
|
||||||
cd ..\Downloads
|
cd ..\Downloads
|
||||||
$env:PATH="$($PWD.Path)\go-ipfs;$($env:PATH)"
|
$env:PATH="$($PWD.Path)\go-ipfs;$($env:PATH)"
|
||||||
$env:PATH="$($env:USERPROFILE)\.yarn\bin;$($env:USERPROFILE)\.config\yarn\global\node_modules\.bin;$($env:PATH)"
|
$env:PATH="$($env:USERPROFILE)\.yarn\bin;$($env:USERPROFILE)\.config\yarn\global\node_modules\.bin;$($env:PATH)"
|
||||||
yarn config set cache-folder "$($PWD.Path)\Yarn" | out-null
|
yarn config set cache-folder "$($YARN_CACHE_FOLDER)" | out-null
|
||||||
popd
|
popd
|
||||||
npm run ci:full
|
npm run ci:full
|
||||||
condition: and( succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ) )
|
condition: and( succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ) )
|
||||||
|
|
Loading…
Reference in New Issue