1
0
Fork 0

split github actions in two jobs

This commit is contained in:
Maurizio Porrato 2023-08-19 10:26:58 +01:00
parent 3865d38ca1
commit 1d898cec0d
3 changed files with 28 additions and 7 deletions

View File

@ -13,12 +13,26 @@ on:
- .gitignore
jobs:
tox:
lint:
name: Linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
- name: Install dependencies
run: pdm install -d -G lint -G test
- name: Test with tox
run: pdm run tox -e pylint,mypy,bandit
unit-tests:
name: Unit tests
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up PDM
@ -26,7 +40,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pdm install -d -G test -G lint
run: pdm install -d -G test
- name: Test with tox
run: pdm run tox

View File

@ -34,6 +34,7 @@ lint = [
"types-PyYAML>=6.0.12.11",
"mypy>=1.5.1",
"bandit[toml]>=1.7.5",
"tox-pdm>=0.6.1",
]
[tool.pylint.main]

13
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
envlist = pylint, mypy, bandit, py{39,310,311,py39}
isolated_build = True ; This is required for a pyproject.toml based project.
isolated_build = True
[gh-actions]
python =
@ -9,19 +9,26 @@ python =
3.11: py311
[testenv]
groups = ; Dependency groups in pyproject.toml
dev
groups =
test
commands =
pytest --cov-report term-missing --cov-fail-under=100 --cov=operator_repo -v tests/
[testenv:pylint]
groups =
lint
commands =
pylint src
[testenv:mypy]
groups =
test
lint
commands =
mypy --strict src tests
[testenv:bandit]
groups =
lint
commands =
bandit -c pyproject.toml -r .