split github actions in two jobs
This commit is contained in:
parent
3865d38ca1
commit
1d898cec0d
|
@ -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
|
||||
|
|
|
@ -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
13
tox.ini
|
@ -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 .
|
||||
|
|
Loading…
Reference in New Issue