Skip to content

Commit 19e9ed0

Browse files
committed
ci(action): switch to uv commands
1 parent c4121c2 commit 19e9ed0

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

.github/workflows/pipeline.yml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,69 +15,65 @@ permissions:
1515

1616
jobs:
1717
ruff:
18-
name: "Ruff Linting"
18+
name: Ruff Linting
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Check out repository
2222
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
3029
- name: Ruff (linting + formating)
3130
id: ruff
3231
run: |
33-
source .venv/bin/activate
34-
pre-commit run --all
32+
uv run pre-commit run --all
3533
- name: Generate Badges
3634
if: success() || failure()
3735
run: |
38-
source .venv/bin/activate
3936
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'
4340
- 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)
4542
uses: JamesIves/github-pages-deploy-action@v4
4643
with:
4744
folder: badges/
4845
clean: false
4946

5047
pytest:
48+
name: Pytest Tests
5149
runs-on: ubuntu-latest
52-
name: "Pytest Tests"
5350
strategy:
5451
matrix:
55-
python-version: [ "3.10", "3.11", "3.12" ]
52+
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
5653
steps:
5754
- name: Check out repository
5855
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
6258
with:
6359
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
6664
- name: Run Pytest
6765
id: pytest
6866
run: |
69-
source .venv/bin/activate
70-
coverage run -m pytest tests/
67+
uv run coverage run -m pytest tests/
7168
- name: Generate Badges
7269
if: success() || failure()
7370
run: |
74-
source .venv/bin/activate
75-
coverage report
71+
uv run coverage report
7672
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
7975
- 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)
8177
uses: JamesIves/github-pages-deploy-action@v4
8278
with:
8379
folder: badges/
@@ -96,11 +92,14 @@ jobs:
9692
steps:
9793
- name: Check out repository
9894
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
101101
- name: Build Project
102102
run: |
103-
source .venv/bin/activate
104-
poetry build
103+
uv build
105104
- name: Publish package distributions to PyPI
106105
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)