11name : test_and_publish
22
3- on :
3+ on :
44 push :
55 tags :
66 - ' client-*'
77
8+
89jobs :
9- test :
10+ run :
11+ name : " Build and publish release"
1012 runs-on : ubuntu-latest
11- defaults :
12- run :
13- working-directory : ./python-package/cartiflette
13+
1414 steps :
15- # ----------------------------------------------
16- # check-out repo and set-up python
17- # ----------------------------------------------
18- - name : Check out repository
19- uses : actions/checkout@v3
20- - name : Set up python
21- id : setup-python
22- uses : actions/setup-python@v4
15+ - uses : actions/checkout@v4
16+
17+ - name : Install uv
18+ uses : astral-sh/setup-uv@v3
2319 with :
24- python-version : ' 3.9'
25- # ----------------------------------------------
26- # ----- install & configure poetry -----
27- # ----------------------------------------------
28- - name : Install Poetry
29- uses : snok/install-poetry@v1
20+ enable-cache : true
21+ cache-dependency-glob : uv.lock
3022
31- # ----------------------------------------------
32- # install dependencies if cache does not exist
33- # ----------------------------------------------
34- - name : Install dependencies
35- run : poetry install --no-interaction --without dev
23+ - name : Set up Python
24+ run : uv python install 3.12 # Or whatever version I want to use.
3625
37- # ----------------------------------------------
38- # add only pytest for tests (not the full dev dependencies)
39- # ----------------------------------------------
40- - name : Add pytest
41- run : poetry run pip install pytest
26+ - name : Build
27+ run : uv build
4228
43- # ----------------------------------------------
44- # add only pytest-cov for tests (not the full dev dependencies)
45- # ----------------------------------------------
46- - name : Add pytest-cov
47- run : poetry run pip install pytest-cov
29+ - name : Publish
30+ run : uv publish --token ${{ secrets.PAT_PYPI }}
4831
49- # ----------------------------------------------
50- # run test suite
51- # ----------------------------------------------
52- - name : Run tests
53- run : poetry run pytest --cov -W error
54-
55- publish :
56- runs-on : ubuntu-latest
57- defaults :
58- run :
59- working-directory : ./python-package/cartiflette
60- needs : test
61- steps :
62- # ----------------------------------------------
63- # check-out repo and set-up python
64- # ----------------------------------------------
65- - name : Check out repository
66- uses : actions/checkout@v3
67- - name : Set up python
68- id : setup-python
69- uses : actions/setup-python@v4
70- with :
71- python-version : ' 3.9'
72- # ----------------------------------------------
73- # ----- install & configure poetry -----
74- # ----------------------------------------------
75- - name : Install Poetry
76- uses : snok/install-poetry@v1
77-
78- # ----------------------------------------------
79- # config pypi token
80- # ----------------------------------------------
81- - name : Set pypi token
82- run : poetry config pypi-token.pypi ${{secrets.PAT_PYPI}}
83-
84- # ----------------------------------------------
85- # build
86- # ----------------------------------------------
87- - name : Build
88- run : poetry build
89-
90- # ----------------------------------------------
91- # run test suite
92- # ----------------------------------------------
93- - name : Publish to Pypi
94- run : poetry publish
0 commit comments