diff --git a/.ci/esy-build-steps.yml b/.ci/esy-build-steps.yml index 07630b9..21bb377 100644 --- a/.ci/esy-build-steps.yml +++ b/.ci/esy-build-steps.yml @@ -4,6 +4,7 @@ steps: - task: NodeTool@0 inputs: versionSpec: '8.9' + - template: ./use-cache-esy.yml - script: npm i -g esy - script: npm install - script: npm run build-exe diff --git a/.ci/use-cache-esy.yml b/.ci/use-cache-esy.yml new file mode 100644 index 0000000..d65ecd5 --- /dev/null +++ b/.ci/use-cache-esy.yml @@ -0,0 +1,19 @@ +--- +steps: + - task: Cache@2 + inputs: + key: 'v1 | esy-install-cache | "$(Agent.OS)" | "$(Build.SourcesDirectory)/esy.lock/index.json"' # vPrimary, here, is just a way to bust cache during debugging. Inspired from https://docs.microsoft.com/en-us/azure/devops/pipelines/caching/?view=azure-devops#can-i-clear-a-cache" + restoreKeys: | + v1 | esy-install-cache | ${{ parameters.platform }} + path: $(ESY__CACHE_INSTALL_PATH) + cacheHitVar: ESY_INSTALL_CACHE_RESTORED + displayName: "Caching $(ESY__CACHE_INSTALL_PATH)" + - task: Cache@2 + inputs: + key: 'v1 | esy-sources | "$(Agent.OS)" | "$(Build.SourcesDirectory)/esy.lock/index.json"' # vPrimary, here, is just a way to bust cache during debugging. Inspired from https://docs.microsoft.com/en-us/azure/devops/pipelines/caching/?view=azure-devops#can-i-clear-a-cache" + restoreKeys: | + v1 | esy-sources | "$(Agent.OS)" + v1 | esy-sources + path: "$(ESY__CACHE_INSTALL_PATH)/../../source" + cacheHitVar: ESY_SOURCE_CACHE_RESTORED + displayName: "Caching $(ESY__CACHE_INSTALL_PATH)/../../source"