Skip to content

Commit 370f334

Browse files
committed
Update GitHub test action
1 parent e7cd6f5 commit 370f334

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: test
22

3-
on:
3+
on:
44
push:
5-
workflow_dispatch:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
68

79
jobs:
810
build:
@@ -11,14 +13,23 @@ jobs:
1113
fail-fast: false
1214
matrix:
1315
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
14-
1516
steps:
16-
- uses: actions/checkout@v4
17-
18-
- name: install virtual env
19-
run: |
20-
pip install virtualenv
21-
22-
- name: make test
23-
run: |
24-
make test
17+
- uses: actions/checkout@v4
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install flake8 pytest
26+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27+
- name: Lint with flake8
28+
run: |
29+
# stop the build if there are Python syntax errors or undefined names
30+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
31+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
32+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics
33+
- name: Test with pytest
34+
run: |
35+
PYTHONPATH=src/ pytest --doctest-modules --doctest-continue-on-failure

0 commit comments

Comments
 (0)