Skip to content

Commit 804c624

Browse files
committed
ci: add python linting, formatting and type-checking
1 parent 6c0db6f commit 804c624

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/code_quality.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Code Quality
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
workflow_dispatch:
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
jobs:
12+
ruff:
13+
name: Ruff
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Ruff Check
18+
uses: astral-sh/ruff-action@v3
19+
with:
20+
version: latest
21+
- name: Ruff Format
22+
uses: astral-sh/ruff-action@v3
23+
with:
24+
version: latest
25+
args: format --check
26+
pyright:
27+
name: Type Check
28+
runs-on: ubuntu-latest
29+
needs: ruff
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version-file: ".python-version"
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v5
38+
with:
39+
enable-cache: true
40+
cache-dependency-glob: "uv.lock"
41+
- name: Install dependencies
42+
run: |
43+
uv venv
44+
uv sync --dev
45+
- name: Run pyright
46+
run: |
47+
source .venv/bin/activate
48+
basedpyright

0 commit comments

Comments
 (0)