Skip to content

Commit 1204327

Browse files
authored
ci: split workflow, add isort and black checks (#301)
1 parent 4e82674 commit 1204327

3 files changed

Lines changed: 40 additions & 3 deletions

File tree

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- "docs/**"
1414

1515
jobs:
16-
test:
16+
lint:
1717
runs-on: ubuntu-latest
1818

1919
steps:
@@ -41,5 +41,8 @@ jobs:
4141
- name: Lint with mypy
4242
run: mypy $(git ls-files '*.py')
4343

44-
- name: Test with pytest
45-
run: pytest --cov src tests/
44+
- name: Check code formatting with black
45+
run: black --check --diff $(git ls-files '*.py')
46+
47+
- name: Check code formatting with isort
48+
run: isort --check-only --diff $(git ls-files '*.py')

.github/workflows/test.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+
paths-ignore:
7+
- "README.md"
8+
- "docs/**"
9+
pull_request:
10+
branches: [main]
11+
paths-ignore:
12+
- "README.md"
13+
- "docs/**"
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
- name: Set up Python 3.10
22+
uses: actions/setup-python@v6
23+
with:
24+
python-version: "3.10"
25+
- name: Install dependencies for requirements and testing
26+
run: |
27+
python -m pip install --upgrade pip
28+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
30+
31+
- name: Test with pytest
32+
run: pytest --cov src tests/

requirements_dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ pytest-cov
44
pylint
55
mypy
66
flake8
7+
black
8+
isort

0 commit comments

Comments
 (0)