Skip to content

Commit e36e9fb

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

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

.github/workflows/pipeline.yml

+33-33
Original file line numberDiff line numberDiff line change
@@ -15,69 +15,66 @@ 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.11", "3.12", "3.13" ]
53+
fail-fast: false
5654
steps:
5755
- name: Check out repository
5856
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
6259
with:
6360
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
6665
- name: Run Pytest
6766
id: pytest
6867
run: |
69-
source .venv/bin/activate
70-
coverage run -m pytest tests/
68+
uv run coverage run -m pytest tests/
7169
- name: Generate Badges
7270
if: success() || failure()
7371
run: |
74-
source .venv/bin/activate
75-
coverage report
72+
uv run coverage report
7673
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
7976
- 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)
8178
uses: JamesIves/github-pages-deploy-action@v4
8279
with:
8380
folder: badges/
@@ -96,11 +93,14 @@ jobs:
9693
steps:
9794
- name: Check out repository
9895
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
101102
- name: Build Project
102103
run: |
103-
source .venv/bin/activate
104-
poetry build
104+
uv build
105105
- name: Publish package distributions to PyPI
106106
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)