@@ -14,60 +14,56 @@ jobs:
14
14
strategy :
15
15
fail-fast : false
16
16
matrix :
17
- python-version : [ "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.8", "pypy3.9" ]
18
- poetry-version : [ "latest" ]
19
- os : [ ubuntu-20.04, macos-latest, windows-latest ]
17
+ config :
18
+ - python-version : ' 3.11'
19
+ tox : py311
20
+ poetry-version : [ "1.8.2" ]
21
+ os : [ ubuntu-22.04, macos-latest, windows-latest ]
20
22
runs-on : ${{ matrix.os }}
21
- name : Python ${{ matrix.python-version }} / Poetry ${{ matrix.poetry-version }} / ${{ matrix.os }}
23
+ name : Python ${{ matrix.config. python-version }} / Poetry ${{ matrix.poetry-version }} / ${{ matrix.os }}
22
24
defaults :
23
25
run :
24
26
shell : bash
25
27
steps :
26
28
- uses : actions/checkout@v3
27
29
with :
28
30
fetch-depth : 0
29
- - name : Set up Python ${{ matrix.python-version }}
30
- uses : actions/setup-python@v4
31
+ - uses : actions/checkout@v4
32
+ - name : Install poetry
33
+ run : pipx install poetry
34
+ - name : Install Python ${{ matrix.config.python-version }}
35
+ uses : actions/setup-python@v5
31
36
with :
32
- python-version : ${{ matrix.python-version }}
33
- cache : ' pip'
34
- - name : Update pip
35
- run : |
36
- python -m pip install --upgrade pip
37
- - name : Run Poetry action
38
- uses : abatilo/actions-poetry@v2
39
- with :
40
- poetry-version : ${{ matrix.poetry-version }}
41
- - name : View poetry --version
42
- run : poetry --version
43
- - name : Install dependencies
44
- run : poetry install
45
- - name : Run tests
46
- run : poetry run pytest
47
- - name : Upload coverage to Codecov
48
- uses : codecov/codecov-action@v1
37
+ python-version : ${{ matrix.config.python-version }}
38
+ cache : ' poetry'
39
+ - name : Install packages
40
+ run : poetry install --no-root
41
+ - name : Load cached tox
42
+ uses : actions/cache@v3
49
43
with :
50
- token : ${{ secrets.CODECOV_TOKEN }}
51
- flags : unittests
52
- env_vars : OS,PYTHON
53
- name : codecov-umbrella
54
- fail_ci_if_error : true
55
- verbose : true
44
+ path : .tox
45
+ key : tox-${{ matrix.os }}-poetry-${{ matrix.poetry-version }}-python-${{ matrix.config.python-version }}-${{ hashFiles('**/poetry.lock') }}
46
+ - name : Setup API Key
47
+ env :
48
+ ORS_API_KEY : ${{ secrets.ORS_API_KEY }}
49
+ run : printf "[ORS]\napiKey = $ORS_API_KEY\n" > tests-config.ini
50
+ - name : Run tox
51
+ run : |
52
+ poetry run tox -e pytest-${{ matrix.config.tox }}
53
+
56
54
build-and-publish :
57
55
name : Build and publish Python distributions 📦 to PyPI and TestPyPI
58
56
runs-on : ubuntu-20.04
59
- needs :
60
- - pytest
57
+ needs : pytest
61
58
steps :
62
- - uses : actions/checkout@v2
63
- - name : Set up base Python 3.9
64
- uses : actions/setup-python@v2
65
- with :
66
- python-version : 3.9
67
- - name : Python Poetry Action
68
- uses : abatilo/actions-poetry@v2
59
+ - uses : actions/checkout@v4
60
+ - name : Install poetry
61
+ run : pipx install poetry
62
+ - name : Install Python ${{ matrix.config.python-version }}
63
+ uses : actions/setup-python@v5
69
64
with :
70
- poetry-version : latest
65
+ python-version : ${{ matrix.config.python-version }}
66
+ cache : ' poetry'
71
67
- name : Publish distribution 📦 with test.pypi.org
72
68
if : startsWith(github.ref, 'refs/tags/v')
73
69
run : |
0 commit comments