File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,10 +20,31 @@ jobs:
2020 uses : actions/setup-python@v2
2121 with :
2222 python-version : ${{ matrix.python-version }}
23- - name : Install dependencies
23+
24+ - name : Install Poetry
25+ uses : dschep/install-poetry-action@v1.2
26+
27+ - name : Cache Poetry virtualenv
28+ uses : actions/cache@v1
29+ id : cache
30+ with :
31+ path : ~/.virtualenvs
32+ key : poetry-${{ hashFiles('**/poetry.lock') }}
33+ restore-keys : |
34+ poetry-${{ hashFiles('**/poetry.lock') }}
35+
36+ - name : Set Poetry config
2437 run : |
25- python -m pip install --upgrade pip
26- pip install flake8 pytest
27- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28- - name : Black Code Formatter
29- uses : lgeiger/black-action@v1.0.1
38+ poetry config settings.virtualenvs.in-project false
39+ poetry config settings.virtualenvs.path ~/.virtualenvs
40+
41+ - name : Install Dependencies
42+ run : poetry install
43+ if : steps.cache.outputs.cache-hit != 'true'
44+
45+ - name : Formatting
46+ run : poetry run black . --check
47+
48+ - name : Test with pytest
49+ run : poetry run pytest -n 2
50+
You can’t perform that action at this time.
0 commit comments