Skip to content

Commit ba8bb0f

Browse files
committed
Separate out linting
1 parent cae0506 commit ba8bb0f

2 files changed

Lines changed: 33 additions & 8 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: lint
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches: [main, develop]
7+
pull_request:
8+
branches: [main, develop]
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up Python 3.8
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: 3.8
19+
- name: Lint with flake8
20+
run: |
21+
pip3 install -r requirements-dev.txt
22+
# Stop the build if there are Python syntax errors, undefined names or unused imports etc.
23+
flake8
24+
# Do not stop the build, but indicate room for improvement.
25+
# exit-zero treats all errors as warnings.
26+
flake8 . --exit-zero --ignore= --select=

.github/workflows/pythonpackage.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ on:
1010
branches: [main, develop]
1111
pull_request:
1212
branches: [main, develop]
13+
workflow_run:
14+
workflows: ["lint"]
15+
# branches: [main]
16+
types:
17+
- completed
1318

1419
jobs:
1520
build:
1621
runs-on: ${{ matrix.os }}
22+
needs: [lint]
1723
timeout-minutes: 180
1824
strategy:
1925
fail-fast: false
@@ -27,18 +33,11 @@ jobs:
2733
uses: actions/setup-python@v3
2834
with:
2935
python-version: ${{ matrix.python-version }}
30-
- name: Lint with flake8
31-
run: |
32-
pip3 install -r requirements-dev.txt
33-
# Stop the build if there are Python syntax errors, undefined names or unused imports etc.
34-
flake8
35-
# Do not stop the build, but indicate room for improvement.
36-
# exit-zero treats all errors as warnings.
37-
flake8 . --exit-zero --ignore= --select=
3836
- name: Install dependencies
3937
run: |
4038
python3 -m pip install --upgrade pip
4139
pip3 install -r requirements.txt
40+
pip3 install -r requirements-dev.txt
4241
#- name: Typilus, Suggest Python Type Annotations
4342
# uses: typilus/typilus-action@v0.9
4443
- name: Run unittests

0 commit comments

Comments
 (0)