@@ -11,56 +11,31 @@ jobs:
1111 fail-fast : false
1212 steps :
1313 - name : Checkout code
14- uses : actions/checkout@v3
14+ uses : actions/checkout@v4
15+
16+ - name : Install Poetry
17+ run : pipx install "poetry>=1.4.0,<1.5.0"
1518
1619 - name : Set up Python ${{ matrix.python-version }}
17- uses : actions/setup-python@v3
20+ uses : actions/setup-python@v5
1821 with :
1922 python-version : ${{ matrix.python-version }}
23+ cache : poetry
2024
2125 - name : Display Python version
22- run : python -c "import sys; print(sys.version)"
26+ run : poetry run python -c "import sys; print(sys.version)"
2327
2428 - name : Display pip version
25- run : python -m pip --version
26-
27- - name : Get pip version
28- id : pip-version
29- run : echo "PIP_VERSION=$(python -m pip --version | cut -f 2 -d ' ')" >> $GITHUB_OUTPUT
30-
31- - name : Install Poetry
32- run : pipx install "poetry>=1.4.0,<1.5.0"
29+ run : poetry run python -m pip --version
3330
3431 - name : Display Poetry version
3532 run : poetry --version
3633
37- - name : Get Poetry version
38- id : poetry-version
39- run : echo "POETRY_VERSION=$(poetry --version | cut -f 3- -d ' ')" >> $GITHUB_OUTPUT
40-
41- # NOTE: Necessary to cache pip files because the cached pypoetry
42- # virtualenv does depend on them.
43- - name : Cache pip files
44- id : cache-pip
45- uses : actions/cache@v3
46- with :
47- path : ~/.cache/pip
48- key : pip--os-${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ steps.pip-version.outputs.PIP_VERSION }}-poetry-${{ steps.poetry-version.outputs.POETRY_VERSION }}-lock-${{ hashFiles('poetry.lock') }}
49-
50- - name : Cache installed dependencies
51- id : cache-pypoetry
52- uses : actions/cache@v3
53- with :
54- path : ~/.cache/pypoetry/virtualenvs
55- key : pypoetry--os-${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ steps.pip-version.outputs.PIP_VERSION }}-poetry-${{ steps.poetry-version.outputs.POETRY_VERSION }}-lock-${{ hashFiles('poetry.lock') }}
56-
5734 - name : Install dependencies with Poetry
58- if : ${{ (steps.cache-pip.outputs.cache-hit != 'true') || (steps.cache-pypoetry.outputs.cache-hit != 'true') }}
5935 run : poetry install
6036
6137 - name : Lint
6238 run : poetry run make lint
6339
6440 - name : Run tests
65- # Run tox using the version of Python in `PATH`
66- run : poetry run tox -e py
41+ run : poetry run python -m unittest
0 commit comments