Skip to content

Commit b7031d0

Browse files
committed
Add ci.yml to run ruff format/check & tests on a python matrix
1 parent b8e036e commit b7031d0

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
tests-and-linting:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
cache: 'pip'
23+
cache-dependency-path: '**/pyproject.toml'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install .[testing,dev]
29+
30+
- name: Check Python linting (Ruff)
31+
run: ruff check --output-format=github
32+
33+
- name: Check Python formatting (Ruff)
34+
run: ruff format --check
35+
36+
- name: Run tests
37+
run: python runtests.py

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ python runtests.py
210210
```
211211

212212

213-
### Formatting
213+
### Linting and formatting
214214

215-
```
215+
```bash
216216
pip install -r requirements.txt
217-
black .
218-
```
217+
ruff check
218+
ruff format
219+
```

0 commit comments

Comments
 (0)