Skip to content

Commit 60ae814

Browse files
committed
ci(action): add ruff job
1 parent b7723ae commit 60ae814

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/pipeline.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,44 @@ on:
1010
branches:
1111
- main
1212

13+
permissions:
14+
contents: write
15+
1316
jobs:
17+
ruff:
18+
name: Ruff Linting
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out repository
22+
uses: actions/checkout@v4
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
29+
- name: Ruff (linting + formating)
30+
id: ruff
31+
run: |
32+
uv run pre-commit run --all
33+
- name: Generate Badges
34+
if: success() || failure()
35+
run: |
36+
mkdir -p badges/
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'
40+
- name: Publish badges to GitHub Pages
41+
if: (success() || failure()) && (github.ref_name == github.event.repository.default_branch)
42+
uses: JamesIves/github-pages-deploy-action@v4
43+
with:
44+
folder: badges/
45+
clean: false
46+
1447
pypi-publish:
1548
name: Upload release to PyPI
1649
runs-on: ubuntu-latest
50+
needs: [ ruff ]
1751
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
1852
environment:
1953
name: pypi

0 commit comments

Comments
 (0)