Skip to content

Commit 6f79fcf

Browse files
committed
configure tox for linting, add linting step to main.yml
1 parent 31bf412 commit 6f79fcf

File tree

2 files changed

+40
-12
lines changed

2 files changed

+40
-12
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build ⚙️
1+
name: Build PyWPS ⚙️
22

33
on:
44
push:
@@ -7,7 +7,28 @@ on:
77
pull_request:
88

99
jobs:
10+
lint:
11+
name: Linting Suite
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Cancel previous runs
15+
uses: styfle/[email protected]
16+
with:
17+
access_token: ${{ github.token }}
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.9"
22+
- name: Install tox
23+
run: |
24+
pip install tox>=4.0
25+
- name: Run linting suite ⚙️
26+
run: |
27+
tox -e lint
28+
1029
test:
30+
name: Testing with Python${{ matrix.python-version }}
31+
needs: lint
1132
runs-on: ubuntu-latest
1233
strategy:
1334
matrix:
@@ -21,20 +42,15 @@ jobs:
2142
- tox-env: py311-extra
2243
python-version: "3.11"
2344
steps:
24-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@v4
2546
- name: Install packages 📦
2647
run: |
2748
sudo apt-get update
2849
sudo apt-get -y install libnetcdf-dev libhdf5-dev
29-
- uses: actions/setup-python@v4
50+
- uses: actions/setup-python@v5
3051
name: Setup Python ${{ matrix.python-version }}
3152
with:
3253
python-version: ${{ matrix.python-version }}
33-
- name: Run flake8 ⚙️
34-
run: |
35-
pip install flake8
36-
flake8 pywps
37-
if: matrix.python-version == 3.8
3854
- name: Install tox 📦
3955
run: pip install "tox>=4.0"
4056
- name: Run tests with tox ⚙️
@@ -44,14 +60,16 @@ jobs:
4460
uses: AndreMiras/coveralls-python-action@develop
4561

4662
docs:
63+
name: Build docs 🏗️
64+
needs: lint
4765
runs-on: ubuntu-latest
4866
steps:
49-
- uses: actions/checkout@v3
50-
- uses: actions/setup-python@v4
67+
- uses: actions/checkout@v4
68+
- uses: actions/setup-python@v5
5169
name: Setup Python 3.8
5270
with:
5371
python-version: 3.8
54-
- name: Build docs 🏗️
72+
- name: Build documentation 🏗️
5573
run: |
5674
pip install -e .[dev]
5775
cd docs && make html

tox.ini

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
[tox]
22
min_version = 4.0
3-
envlist = py{37,38,39,310,311}{-extra,}
3+
envlist =
4+
py{37,38,39,310,311}{-extra,},
5+
lint
46
requires = pip >= 20.0
57
opts = --verbose
68

9+
[testenv:lint]
10+
skip_install = true
11+
extras =
12+
deps =
13+
flake8
14+
commands =
15+
flake8 pywps
16+
717
[testenv]
818
setenv =
919
PYTEST_ADDOPTS = "--color=yes"

0 commit comments

Comments
 (0)