@@ -15,69 +15,66 @@ 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.11", "3.12", "3.13" ]
53
+ fail-fast : false
56
54
steps :
57
55
- name : Check out repository
58
56
uses : actions/checkout@v4
59
- - name : Set up python
60
- id : setup-python
61
- uses : actions/setup-python@v5
57
+ - name : Install UV
58
+ uses : astral-sh/setup-uv@v4
62
59
with :
63
60
python-version : ${{ matrix.python-version }}
64
- - name : Setup Poetry
65
- uses : ./.github/actions/setup-poetry
61
+ - name : Set up Python
62
+ run : uv python install
63
+ - name : Install the project
64
+ run : uv sync --dev
66
65
- name : Run Pytest
67
66
id : pytest
68
67
run : |
69
- source .venv/bin/activate
70
- coverage run -m pytest tests/
68
+ uv run coverage run -m pytest tests/
71
69
- name : Generate Badges
72
70
if : success() || failure()
73
71
run : |
74
- source .venv/bin/activate
75
- coverage report
72
+ uv run coverage report
76
73
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
74
+ uv run anybadge --overwrite --value="${{ steps.pytest.outcome }}" --label=pytest --file=badges/pytest.svg success=green failure=red
75
+ uv run anybadge --overwrite --value="$(uv run coverage report --format=total)" --file=badges/coverage.svg coverage
79
76
- name : Publish badges to GitHub Pages
80
- if : github.event_name == 'push' && startsWith (github.ref, 'refs/tags' )
77
+ if : (success() || failure()) && (github.ref_name == github.event.repository.default_branch )
81
78
uses : JamesIves/github-pages-deploy-action@v4
82
79
with :
83
80
folder : badges/
@@ -96,11 +93,14 @@ jobs:
96
93
steps :
97
94
- name : Check out repository
98
95
uses : actions/checkout@v4
99
- - name : Setup Poetry
100
- uses : ./.github/actions/setup-poetry
96
+ - name : Install UV
97
+ uses : astral-sh/setup-uv@v4
98
+ - name : Set up Python
99
+ run : uv python install
100
+ - name : Install the project
101
+ run : uv sync --dev
101
102
- name : Build Project
102
103
run : |
103
- source .venv/bin/activate
104
- poetry build
104
+ uv build
105
105
- name : Publish package distributions to PyPI
106
106
uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments