gitlab ci caching

+ add pip caching
+ add venv caching
This commit is contained in:
nico 2020-06-27 00:33:10 +02:00
parent e503508b5b
commit 453d054ebb
Signed by: mightyBroccoli
GPG Key ID: EA7C31AAB1BDC1A2
1 changed files with 16 additions and 1 deletions

View File

@ -1,10 +1,23 @@
image: "python:3.7" image: "python:3.7"
variables:
# force pip cache dir
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
# utilize pip caching
- .cache/pip
# cache the virtualenv to reduce load
- venv/
# setup environemnt # setup environemnt
before_script: before_script:
- python --version - python --version
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt - pip install -r requirements.txt
- pip install flake8
stages: stages:
- syntax - syntax
@ -12,6 +25,8 @@ stages:
syntax: syntax:
stage: syntax stage: syntax
before_script:
- pip install flake8
script: script:
# breaking errors ie syntax errors # breaking errors ie syntax errors
- flake8 --select=E9,F63,F7,F82 --show-source - flake8 --select=E9,F63,F7,F82 --show-source