9
9
steps :
10
10
- uses : actions/checkout@v2
11
11
- uses : actions/setup-python@v2
12
- - uses : actions/cache@v2
13
12
with :
14
- path : ~/.cache/pip
15
- key : ${{ runner.os }}-pip
16
- restore-keys : ${{ runner.os }}-pip
13
+ python-version : 3.9
17
14
- name : Install Poetry
18
- uses : snok/install-poetry@v1.1.1
15
+ uses : snok/install-poetry@v1
19
16
with :
20
17
virtualenvs-create : true
21
18
virtualenvs-in-project : true
22
- # virtualenvs-path: ~/.venv
23
-
24
- - name : Ensure cache is healthy
25
- if : steps.cache.outputs.cache-hit == 'true'
26
- shell : bash
27
- run : timeout 10s poetry run pip --version || rm -rf .venv
19
+ installer-parallel : true
28
20
21
+ # virtualenvs-path: ~/.venv
29
22
- name : Load cached venv
30
23
id : cached-poetry-dependencies
31
24
uses : actions/cache@v2
@@ -34,22 +27,22 @@ jobs:
34
27
key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
35
28
# install dependencies if cache does not exist
36
29
- name : Check cache and install dependencies
37
- run : poetry install
30
+ run : poetry install --no-interaction --no-root
38
31
if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
32
+ # poetry run pre-commit run --all-files
39
33
- name : Run linters
40
34
run : |
41
- source .venv/bin/activate
42
- # flake8 .
43
- black . --check
44
- isort .
35
+ poetry run pre-commit run --all-files
36
+
45
37
46
38
test :
47
- needs : linting
39
+ # XXX needs: linting
48
40
strategy :
49
- fail-fast : true
41
+ fail-fast : false
50
42
matrix :
51
43
os : [ "ubuntu-latest", "macos-latest" ]
52
- python-version : [ "3.6", "3.7", "3.8", "3.9" ]
44
+ python-version : [ "3.7", "3.8", "3.9" ]
45
+ # django-version: [ "django>=2.2,<3", "django>=3.1,<4" ]
53
46
runs-on : ${{ matrix.os }}
54
47
steps :
55
48
- name : Check out repository
@@ -58,36 +51,12 @@ jobs:
58
51
uses : actions/setup-python@v2
59
52
with :
60
53
python-version : ${{ matrix.python-version }}
61
- - name : Install Poetry
62
- uses : snok/install-poetry@v1.1.1
63
- with :
64
- virtualenvs-create : true
65
- virtualenvs-in-project : true
66
- - name : Load cached venv
67
- id : cached-poetry-dependencies
68
- uses : actions/cache@v2
69
- with :
70
- path : .venv
71
- key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
72
- # install dependencies if cache does not exist
73
- - name : Check cache and install dependencies
74
- run : poetry install
75
- if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
76
- - name : Run tests
54
+ - name : Install dependencies
77
55
run : |
78
- source .venv/bin/activate
79
- pip install tox-gh-actions
80
- tox
81
- coverage report
82
- # upload coverage stats
83
- - name : Upload coverage
84
- uses : codecov/codecov-action@v1
85
- with :
86
- file : ./coverage.xml
87
- fail_ci_if_error : true
88
-
89
-
90
- # upload coverage stats
56
+ python -m pip install --upgrade pip
57
+ pip install tox tox-gh-actions
58
+ - name : Run tests
59
+ run : tox
91
60
- name : Upload coverage
92
61
uses : codecov/codecov-action@v1
93
62
with :
0 commit comments