44
44
run : poetry run pytest --black .
45
45
46
46
run_pytest :
47
- name : " pytest ${{ matrix.os }} | python ${{ matrix.os }}"
47
+ name : " pytest ${{ matrix.os }} | ${{ matrix.python-version }}"
48
48
runs-on : ${{ matrix.os }}
49
+ defaults :
50
+ run :
51
+ shell : bash
49
52
strategy :
50
53
fail-fast : false
51
54
matrix :
@@ -55,24 +58,43 @@ jobs:
55
58
steps :
56
59
- uses : actions/checkout@v4
57
60
61
+ - name : Set up python
62
+ uses : actions/setup-python@v5
63
+ with :
64
+ python-version : " ${{ matrix.python-version }}"
65
+
58
66
- name : Set up poetry
59
67
uses : snok/install-poetry@v1
60
68
with :
61
- python-version : ${{ matrix.python-version }}
62
- cache : true
69
+ virtualenvs-create : true
70
+ virtualenvs-in-project : true
63
71
64
- - name : Install Python dependencies
65
- run : poetry install
72
+ - name : Load cached venv
73
+ id : cached-pip-wheels
74
+ uses : actions/cache@v3
75
+ with :
76
+ path : ~/.cache
77
+ key : venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
78
+
79
+ - name : Install dependencies
80
+ run : poetry install --no-interaction --no-root
81
+
82
+ - name : Install app
83
+ run : poetry install --no-interaction
66
84
67
85
- name : Run tests without coverage
68
86
if : ${{ matrix.os != 'ubuntu-latest' && matrix.python-version != '3.11' }}
69
- working-directory : tests/
70
- run : poetry run pytest --junitxml report.xml --cov=. -vv
87
+ run : |
88
+ source .venv/bin/activate
89
+ cd tests/
90
+ poetry run pytest --junitxml report.xml --cov=. -vv
71
91
72
92
- name : Run tests with coverage
73
93
if : ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }}
74
- working-directory : tests/
75
- run : poetry run pytest --junitxml report.xml --cov=. -vv
94
+ run : |
95
+ source .venv/bin/activate
96
+ cd tests/
97
+ poetry run pytest --junitxml report.xml --cov=. -vv
76
98
77
99
- name : Upload to Codecov
78
100
if : ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }}
0 commit comments