diff options
| -rw-r--r-- | azure-pipelines.yml | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d97a13659..d7cf03aae 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,7 @@ # https://aka.ms/yaml variables: + PIP_NO_CACHE_DIR: false PIPENV_HIDE_EMOJIS: 1 PIPENV_IGNORE_VIRTUALENVS: 1 PIPENV_NOSPIN: 1 @@ -12,7 +13,6 @@ jobs: vmImage: ubuntu-18.04 variables: - PIP_CACHE_DIR: ".cache/pip" PRE_COMMIT_HOME: $(Pipeline.Workspace)/pre-commit-cache BOT_API_KEY: foo BOT_SENTRY_DSN: blah @@ -29,11 +29,24 @@ jobs: versionSpec: '3.8.x' addToPath: true + - task: Cache@2 + displayName: 'Restore Python environment' + inputs: + key: python | $(Agent.OS) | "$(PythonVersion.pythonLocation)" | ./Pipfile | ./Pipfile.lock + restoreKeys: | + python | "$(PythonVersion.pythonLocation)" | ./Pipfile.lock + python | "$(PythonVersion.pythonLocation)" | ./Pipfile + python | "$(PythonVersion.pythonLocation)" + cacheHitVar: PY_ENV_RESTORED + path: $(PythonVersion.pythonLocation) + - script: pip install pipenv displayName: 'Install pipenv' + condition: and(succeeded(), ne(variables.PY_ENV_RESTORED, 'true')) - script: pipenv install --dev --deploy --system displayName: 'Install project using pipenv' + condition: and(succeeded(), ne(variables.PY_ENV_RESTORED, 'true')) # Create an executable shell script which replaces the original pipenv binary. # The shell script ignores the first argument and executes the rest of the args as a command. |