Skip to content

Commit 6f347e9

Browse files
committed
refactor(ci): combine flake8 and pytest as 2 jobs of single workflow
1 parent d3fb6be commit 6f347e9

File tree

2 files changed

+24
-38
lines changed

2 files changed

+24
-38
lines changed

.github/workflows/flake8.yml

-36
This file was deleted.

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

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This workflow will install Python dependencies, and run tests supported versions of Python.
1+
# This workflow will install Python dependencies, lint, and run tests in 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: pytest
4+
name: tests
55

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

1515
jobs:
16+
1617
pytest:
1718
strategy:
1819
matrix:
@@ -52,3 +53,24 @@ jobs:
5253
run: |
5354
pytest
5455
56+
flake8:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
- name: Set up Python 3.13
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version: 3.13
64+
- name: Display Python verison
65+
run: python -c "import sys; print(sys.version)"
66+
- name: Install dependencies
67+
run: |
68+
python -m pip install --upgrade pip
69+
pip install flake8
70+
- name: Lint with flake8
71+
run: |
72+
# stop the build if there are Python syntax errors or undefined names
73+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
74+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
75+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
76+

0 commit comments

Comments
 (0)