Skip to content

Commit 8084385

Browse files
ci: add GitHub Actions workflow with ruff lint and pytest
1 parent cc9f778 commit 8084385

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
- run: pip install ruff
18+
- run: ruff check .
19+
- run: ruff format --check .
20+
21+
test:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
python-version: ["3.10", "3.11", "3.12", "3.13"]
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- run: pip install -e ".[dev]"
32+
- run: pytest -q

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,18 @@ dependencies = [
3030
dev = [
3131
"pytest>=7.0",
3232
"pytest-cov>=4.0",
33+
"ruff>=0.4.0",
3334
]
3435

3536
[tool.setuptools.packages.find]
3637
include = ["gateframe*"]
3738

3839
[tool.pytest.ini_options]
3940
testpaths = ["tests"]
41+
42+
[tool.ruff]
43+
target-version = "py310"
44+
line-length = 100
45+
46+
[tool.ruff.lint]
47+
select = ["E", "F", "I", "UP", "B", "SIM"]

0 commit comments

Comments
 (0)