@@ -15,69 +15,65 @@ permissions:
15
15
16
16
jobs :
17
17
ruff :
18
- name : " Ruff Linting"
18
+ name : Ruff Linting
19
19
runs-on : ubuntu-latest
20
20
steps :
21
21
- name : Check out repository
22
22
uses : actions/checkout@v4
23
- - name : Set up python
24
- id : setup-python
25
- uses : actions/setup-python@v5
26
- with :
27
- python-version : ' 3.12'
28
- - name : Setup Poetry
29
- uses : ./.github/actions/setup-poetry
23
+ - name : Install UV
24
+ uses : astral-sh/setup-uv@v4
25
+ - name : Set up Python
26
+ run : uv python install
27
+ - name : Install the project
28
+ run : uv sync --dev
30
29
- name : Ruff (linting + formating)
31
30
id : ruff
32
31
run : |
33
- source .venv/bin/activate
34
- pre-commit run --all
32
+ uv run pre-commit run --all
35
33
- name : Generate Badges
36
34
if : success() || failure()
37
35
run : |
38
- source .venv/bin/activate
39
36
mkdir -p badges/
40
- anybadge --overwrite --label=python --value=3.12+ --file=badges/python.svg --color='dodgerblue'
41
- anybadge --overwrite --value="${{ steps.ruff.outcome }}" --label=ruff --file=badges/ruff.svg success=green failure=red
42
- anybadge --overwrite --label=version --value="v$(poetry version --short )" --file=badges/version.svg --color='green'
37
+ uv run anybadge --overwrite --label=python --value="$(cat .python-version)" --value-format='%.2f' --file=badges/python.svg --color='dodgerblue'
38
+ uv run anybadge --overwrite --value="${{ steps.ruff.outcome }}" --label=ruff --file=badges/ruff.svg success=green failure=red
39
+ uv run anybadge --overwrite --label=version --value="v$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version )" --file=badges/version.svg --color='green'
43
40
- name : Publish badges to GitHub Pages
44
- if : github.event_name == 'push' && startsWith (github.ref, 'refs/tags' )
41
+ if : (success() || failure()) && (github.ref_name == github.event.repository.default_branch )
45
42
uses : JamesIves/github-pages-deploy-action@v4
46
43
with :
47
44
folder : badges/
48
45
clean : false
49
46
50
47
pytest :
48
+ name : Pytest Tests
51
49
runs-on : ubuntu-latest
52
- name : " Pytest Tests"
53
50
strategy :
54
51
matrix :
55
- python-version : [ "3.10", "3.11", "3.12" ]
52
+ python-version : [ "3.10", "3.11", "3.12", "3.13" ]
56
53
steps :
57
54
- name : Check out repository
58
55
uses : actions/checkout@v4
59
- - name : Set up python
60
- id : setup-python
61
- uses : actions/setup-python@v5
56
+ - name : Install UV
57
+ uses : astral-sh/setup-uv@v4
62
58
with :
63
59
python-version : ${{ matrix.python-version }}
64
- - name : Setup Poetry
65
- uses : ./.github/actions/setup-poetry
60
+ - name : Set up Python
61
+ run : uv python install
62
+ - name : Install the project
63
+ run : uv sync --dev
66
64
- name : Run Pytest
67
65
id : pytest
68
66
run : |
69
- source .venv/bin/activate
70
- coverage run -m pytest tests/
67
+ uv run coverage run -m pytest tests/
71
68
- name : Generate Badges
72
69
if : success() || failure()
73
70
run : |
74
- source .venv/bin/activate
75
- coverage report
71
+ uv run coverage report
76
72
mkdir -p badges/
77
- anybadge --overwrite --value="${{ steps.pytest.outcome }}" --label=pytest --file=badges/pytest.svg success=green failure=red
78
- anybadge --overwrite --value="$(coverage report --format=total)" --file=badges/coverage.svg coverage
73
+ uv run anybadge --overwrite --value="${{ steps.pytest.outcome }}" --label=pytest --file=badges/pytest.svg success=green failure=red
74
+ uv run anybadge --overwrite --value="$(uv run coverage report --format=total)" --file=badges/coverage.svg coverage
79
75
- name : Publish badges to GitHub Pages
80
- if : github.event_name == 'push' && startsWith (github.ref, 'refs/tags' )
76
+ if : (success() || failure()) && (github.ref_name == github.event.repository.default_branch )
81
77
uses : JamesIves/github-pages-deploy-action@v4
82
78
with :
83
79
folder : badges/
@@ -96,11 +92,14 @@ jobs:
96
92
steps :
97
93
- name : Check out repository
98
94
uses : actions/checkout@v4
99
- - name : Setup Poetry
100
- uses : ./.github/actions/setup-poetry
95
+ - name : Install UV
96
+ uses : astral-sh/setup-uv@v4
97
+ - name : Set up Python
98
+ run : uv python install
99
+ - name : Install the project
100
+ run : uv sync --dev
101
101
- name : Build Project
102
102
run : |
103
- source .venv/bin/activate
104
- poetry build
103
+ uv build
105
104
- name : Publish package distributions to PyPI
106
105
uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments