Skip to content

Commit

Permalink
Merge pull request #92 from MarcoGorelli/cache-deps
Browse files Browse the repository at this point in the history
CI cache pip dependencies
  • Loading branch information
MarcoGorelli committed Jul 24, 2020
2 parents 4dadab1 + b73ff0c commit 250d440
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ trigger:
- master
name: $(Year:yy)$(DayOfYear)$(Rev:r)


stages:
- stage: Unit_Test
jobs:
Expand All @@ -19,12 +18,24 @@ stages:
Python38:
python.version: '3.8'

variables:
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- task: Cache@2
inputs:
key: 'python | "$(Agent.OS)" | requirements-dev.txt'
restoreKeys: |
python | "$(Agent.OS)"
python
path: $(PIP_CACHE_DIR)
displayName: Cache pip packages

- script: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
Expand All @@ -48,8 +59,6 @@ stages:
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'



- job: 'Test_Windows'
pool:
vmImage: 'vs2017-win2016'
Expand All @@ -62,13 +71,24 @@ stages:
Python38:
python.version: '3.8'

variables:
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- task: Cache@2
inputs:
key: 'python | "$(Agent.OS)" | requirements-dev.txt'
restoreKeys: |
python | "$(Agent.OS)"
python
path: $(PIP_CACHE_DIR)
displayName: Cache pip packages

- script: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
Expand Down

0 comments on commit 250d440

Please sign in to comment.