44 pull_request :
55 branches : ["*"]
66
7- permissions :
8- contents : write
9-
107jobs :
11- format :
8+ tests :
129 runs-on : ubuntu-latest
1310
1411 steps :
1512 - uses : actions/checkout@v4
16- with :
17- ref : ${{ github.head_ref }}
18- token : ${{ secrets.GITHUB_TOKEN }}
1913
2014 - name : Install uv
2115 uses : astral-sh/setup-uv@v4
@@ -30,56 +24,10 @@ jobs:
3024 - name : Install dependencies
3125 run : uv sync --extra dev
3226
33- - name : Run ruff formatting
34- run : uv run ruff format src/ tests/
35-
36- - name : Run ruff linting with auto-fix
37- run : uv run ruff check --fix src/ tests/
38-
39- - name : Re-run formatting after auto-fix
40- run : uv run ruff format src/ tests/
41-
42- - name : Verify all issues are fixed
27+ - name : Check formatting (ruff)
4328 run : |
44- uv run ruff check src/ tests/
4529 uv run ruff format --check src/ tests/
46-
47- - name : Check for changes
48- id : check_changes
49- run : |
50- if [[ -n "$(git status --porcelain)" ]]; then
51- echo "has_changes=true" >> $GITHUB_OUTPUT
52- else
53- echo "has_changes=false" >> $GITHUB_OUTPUT
54- fi
55-
56- - name : Commit and push formatting changes
57- if : steps.check_changes.outputs.has_changes == 'true'
58- run : |
59- git config --local user.email "github-actions[bot]@users.noreply.github.com"
60- git config --local user.name "github-actions[bot]"
61- git add -A
62- git commit -m "style: auto-format code with ruff"
63- git push
64-
65- tests :
66- runs-on : ubuntu-latest
67-
68- steps :
69- - uses : actions/checkout@v4
70-
71- - name : Install uv
72- uses : astral-sh/setup-uv@v4
73- with :
74- version : " latest"
75-
76- - name : Set up Python
77- uses : actions/setup-python@v5
78- with :
79- python-version : " 3.11"
80-
81- - name : Install dependencies
82- run : uv sync --extra dev
30+ uv run ruff check src/ tests/
8331
8432 - name : Run tests
8533 run : uv run pytest tests/ -v
0 commit comments