Skip to content

Commit ce191cf

Browse files
committed
github: add workflows to check formatting and typecheck
1 parent 1657212 commit ce191cf

File tree

5 files changed

+549
-2
lines changed

5 files changed

+549
-2
lines changed

.github/workflows/check-format.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ruff
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
format:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
with:
18+
enable-cache: true
19+
20+
- name: "Set up Python"
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version-file: ".python-version"
24+
25+
- name: Install the project
26+
run: uv sync --frozen --all-extras --dev
27+
28+
- name: Run ruff format check
29+
run: uv run --frozen ruff check .

.github/workflows/check-types.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: typecheck
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
typecheck:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
with:
18+
enable-cache: true
19+
20+
- name: "Set up Python"
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version-file: ".python-version"
24+
25+
- name: Install the project
26+
run: uv sync --frozen --all-extras --dev
27+
28+
- name: Run pyright
29+
run: uv run --frozen pyright

.github/workflows/main.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: actions/setup-python@v5
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
with:
18+
enable-cache: true
19+
20+
- name: "Set up Python"
21+
uses: actions/setup-python@v5
1522
with:
16-
python-version: "3.10"
23+
python-version-file: ".python-version"
1724

1825
- run: pip install .
1926
- run: pip install -U pytest trio

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ target-version = "py38"
3838

3939
[tool.uv]
4040
dev-dependencies = [
41+
"pyright>=1.1.384",
42+
"pytest>=8.3.3",
43+
"ruff>=0.6.9",
4144
"trio>=0.26.2",
4245
]

0 commit comments

Comments
 (0)