1- # Built from:
2- # https://docs.github.com/en/actions/guides/building-and-testing-python
3- # https://github.com/snok/install-poetry#workflows-and-tips
4-
51name : Build and test
62
73on :
@@ -15,73 +11,65 @@ jobs:
1511 runs-on : ubuntu-latest
1612 strategy :
1713 matrix :
18- python-version : [ '3.9 ' ]
14+ python-version : [ '3.11 ' ]
1915 steps :
20- - uses : actions/checkout@v2
16+ - uses : actions/checkout@v4
2117 - name : Set up Python ${{ matrix.python-version }}
22- uses : actions/setup-python@v2
18+ uses : actions/setup-python@v5
2319 with :
2420 python-version : ${{ matrix.python-version }}
25- - name : Install dependencies
26- run : |
27- pip install tox
21+ - name : Install uv
22+ uses : astral-sh/setup-uv@v5
23+ with :
24+ enable-cache : true
25+ - name : Create virtual environment
26+ run : uv venv
27+ - name : Install lint dependencies
28+ run : uv pip install tox
2829 - name : Check code quality with flake8
29- run : tox -e flake8
30+ run : uv run tox -e flake8
3031
3132 test :
3233 runs-on : ubuntu-latest
3334 strategy :
3435 matrix :
35- python-version : [ '3.9 ' ]
36+ python-version : [ '3.11 ' ]
3637
3738 steps :
3839
3940 # ----------------------------------------------
4041 # check-out repo and set-up python
4142 # ----------------------------------------------
4243 - name : Check out repository
43- uses : actions/checkout@v3
44+ uses : actions/checkout@v4
4445
4546 - name : Set up Python ${{ matrix.python-version }}
46- uses : actions/setup-python@v3
47+ uses : actions/setup-python@v5
4748 with :
4849 python-version : ${{ matrix.python-version }}
4950
5051 # ----------------------------------------------
51- # install & configure poetry
52+ # install uv
5253 # ----------------------------------------------
53- - name : Install Poetry
54- uses : snok/install-poetry@v1.3
54+ - name : Install uv
55+ uses : astral-sh/setup-uv@v5
5556 with :
56- virtualenvs-create : true
57- virtualenvs-in-project : true
57+ enable-cache : true
5858
5959 # ----------------------------------------------
60- # load cached venv if cache exists
60+ # create virtualenv
6161 # ----------------------------------------------
62- - name : Load cached venv
63- id : cached-poetry-dependencies
64- uses : actions/cache@v3
65- with :
66- path : .venv
67- key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
62+ - name : Create virtual environment
63+ run : uv venv
6864
6965 # ----------------------------------------------
70- # install dependencies if cache does not exist
66+ # install dependencies
7167 # ----------------------------------------------
7268 - name : Install dependencies
73- if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
74- run : poetry install --no-interaction --no-root
75-
76- # ----------------------------------------------
77- # install your root project, if required
78- # ----------------------------------------------
79- - name : Install library
80- run : poetry install --no-interaction
69+ run : uv pip install .
8170
8271 # ----------------------------------------------
8372 # run test suite
8473 # ----------------------------------------------
8574 - name : Run tests
86- run : poetry run python -m unittest discover
87-
75+ run : uv run python -m unittest discover
0 commit comments