@@ -27,32 +27,42 @@ jobs:
2727 run : sudo apt-get install libcurl4-openssl-dev
2828
2929 - name : Install Poetry
30- 30+ 31+ with :
32+ virtualenvs-create : true
33+ virtualenvs-in-project : true
3134
32- - name : Cache Poetry virtualenv
33- uses : actions/cache@v1
34- id : cache
35+ # ----------------------------------------------
36+ # load cached venv if cache exists
37+ # ----------------------------------------------
38+ - name : Load cached venv
39+ id : cached-poetry-dependencies
40+ uses : actions/cache@v2
3541 with :
36- path : ~/.virtualenvs
37- key : poetry-${{ hashFiles('**/poetry.lock') }}
38- restore-keys : |
39- poetry-${{ hashFiles('**/poetry.lock') }}
42+ path : .venv
43+ key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
44+ # ----------------------------------------------
45+ # install dependencies if cache does not exist
46+ # ----------------------------------------------
47+ - name : Install dependencies
48+ if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
49+ run : poetry install --no-interaction --no-root
4050
41- - name : Set Poetry config
42- run : |
43- poetry config virtualenvs.in-project false
44- poetry config virtualenvs.path ~/.virtualenvs
45-
46- - name : Install Dependencies
47- run : |
48- poetry install
49- if : steps.cache.outputs.cache-hit != 'true'
51+ # ----------------------------------------------
52+ # install your root project, if required
53+ # ----------------------------------------------
54+ - name : Install library
55+ run : poetry install --no-interaction
5056
5157 - name : Code Quality
52- run : poetry run black . --check
58+ run : |
59+ source .venv/bin/activate
60+ black . --check
5361
5462 - name : Test with pytest
55- run : poetry run pytest -n 2 --cov . --cov-report=xml
63+ run : |
64+ source .venv/bin/activate
65+ pytest -n 2 --cov . --cov-report=xml
5666
5767 - name : Upload coverage to Codecov
5868 uses : codecov/codecov-action@v1
6373 name : codecov-umbrella
6474 fail_ci_if_error : true
6575 path_to_write_report : ./codecov_report.gz
66- verbose : true
76+ verbose : true
0 commit comments