From a3e34d3638857606330446e2b027a043d1377b20 Mon Sep 17 00:00:00 2001 From: Vuillemot Florian Date: Mon, 11 Oct 2021 12:17:22 +0200 Subject: [PATCH 1/2] BLD: Add Cache task on Windows --- ci/azure/windows.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml index 3bd20b1399be2..e477416b9fe3e 100644 --- a/ci/azure/windows.yml +++ b/ci/azure/windows.yml @@ -2,6 +2,11 @@ parameters: name: '' vmImage: '' + +variables: + CONDA_CACHE_DIR: $(Pipeline.Workspace)/.condarc + + jobs: - job: ${{ parameters.name }} pool: @@ -41,12 +46,25 @@ jobs: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" Write-Host "##vso[task.prependpath]$HOME/miniconda3/bin" displayName: 'Add conda to PATH' + + - task: Cache@2 + displayName: Use cached Anaconda environment + inputs: + key: 'conda | "$(Agent.OS)" | "ci\\deps\\azure-windows-$(CONDA_PY).yaml"' + restoreKeys: | + python | "$(Agent.OS)" + python + path: $(CONDA_CACHE_DIR) + cacheHitVar: CONDA_CACHE_RESTORED + - script: conda update -q -n base conda displayName: 'Update conda' - bash: | conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml displayName: 'Create anaconda environment' + condition: eq(variables.CONDA_CACHE_RESTORED, 'false') + - bash: | source activate pandas-dev conda list From 85678e9c1f73361ac86097af24949918565b5c99 Mon Sep 17 00:00:00 2001 From: Vuillemot Florian Date: Mon, 11 Oct 2021 13:59:21 +0200 Subject: [PATCH 2/2] Remove useless backslash --- ci/azure/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml index e477416b9fe3e..6b28fab070aac 100644 --- a/ci/azure/windows.yml +++ b/ci/azure/windows.yml @@ -50,7 +50,7 @@ jobs: - task: Cache@2 displayName: Use cached Anaconda environment inputs: - key: 'conda | "$(Agent.OS)" | "ci\\deps\\azure-windows-$(CONDA_PY).yaml"' + key: 'conda | "$(Agent.OS)" | "ci\deps\azure-windows-$(CONDA_PY).yaml"' restoreKeys: | python | "$(Agent.OS)" python