Skip to content

Commit

Permalink
cache saving
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalshaikh42 committed Aug 27, 2019
1 parent 7ad9091 commit d18546b
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions .circleci/config.yml
Expand Up @@ -96,34 +96,45 @@ jobs:
docker:
- image: python:3.6
steps:
#Get package
- restore_cache:
keys:
- source-v1-{{ .Branch }}-{{ .Revision }}
- source-v1-{{.Branch}}-
- checkout
- save_cache:
key: source-v1-{{ .Branch }}-{{ .Revision }}
paths:
- .
#Get main dependencies
- restore_cache:
key:
dependencies-v1-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt"
}}
- run:
name: Install test dependencies
command:
"if [[ -f tests/requirements.txt ]]; then \n pip3\
\ install -r tests/requirements.txt\nfi\n"
key: dependencies-v1-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt"}}

- run:
name: Install Package Dependencies
command: pip3 install -r requirements.txt

- save_cache:
key:
dependencies-v1-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt"
}}
paths:
- /usr/local/lib/python3.6/site-packages
- /user/local/bin
- restore_cache:
key: test-dependencies-v1-{{arch}}-{{ .Branch }}-{{ checksum "tests/requirements.txt"}}

- run:
name: Install test dependencies
command: "if [[ -f tests/requirements.txt ]];
then pip3 install -r tests/requirements.txt
fi"
- save_cache:
key: source-v1-{{ .Branch }}-{{ .Revision }}
key: test-dependencies-v1-{{arch}}-{{ .Branch }}-{{ checksum "tests/requirements.txt"}}
paths:
- .
- /usr/local/lib/python3.6/site-packages
- /usr/local/bin/

test:
working_directory: /root/build
docker:
Expand All @@ -132,10 +143,9 @@ jobs:
- restore_cache:
keys:
- source-v1-{{ .Branch }}-{{ .Revision }}
- checkout
- restore_cache:
key:
dependencies-v1-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt"
}}
key: test-dependencies-v1-{{arch}}-{{ .Branch }}-{{ checksum "tests/requirements.txt"}}
- run:
name: Install package (Python 3)
command: pip3 install -U -e .
Expand Down

0 comments on commit d18546b

Please sign in to comment.