Skip to content

Commit d3fb6be

Browse files
committed
feat(ci): split flake8 from pytest
1 parent 30a1b41 commit d3fb6be

File tree

2 files changed

+40
-10
lines changed

2 files changed

+40
-10
lines changed

.github/workflows/flake8.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will install Python dependencies, and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: flake8
5+
6+
on:
7+
push:
8+
branches: [ "master", "gha" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
flake8:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Python 3.13
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.13
24+
- name: Display Python verison
25+
run: python -c "import sys; print(sys.version)"
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8
30+
- name: Lint with flake8
31+
run: |
32+
# stop the build if there are Python syntax errors or undefined names
33+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36+

.github/workflows/build.yml renamed to .github/workflows/pytest.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
1+
# This workflow will install Python dependencies, and run tests supported versions of Python.
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
33

4-
name: build
4+
name: pytest
55

66
on:
77
push:
@@ -13,7 +13,7 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
build:
16+
pytest:
1717
strategy:
1818
matrix:
1919
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
@@ -46,14 +46,8 @@ jobs:
4646
- name: Install dependencies
4747
run: |
4848
python -m pip install --upgrade pip
49-
pip install flake8 pytest pytest-cov sortedcontainers
49+
pip install pytest pytest-cov sortedcontainers
5050
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
51-
- name: Lint with flake8
52-
run: |
53-
# stop the build if there are Python syntax errors or undefined names
54-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
55-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
56-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
5751
- name: Test with pytest
5852
run: |
5953
pytest

0 commit comments

Comments
 (0)