split github actions in two jobs
This commit is contained in:
parent
3865d38ca1
commit
1d898cec0d
|
@ -13,12 +13,26 @@ on:
|
||||||
- .gitignore
|
- .gitignore
|
||||||
|
|
||||||
jobs:
|
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
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ['3.9', '3.10', '3.11']
|
python-version: ['3.9', '3.10', '3.11']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up PDM
|
- name: Set up PDM
|
||||||
|
@ -26,7 +40,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: pdm install -d -G test
|
||||||
pdm install -d -G test -G lint
|
|
||||||
- name: Test with tox
|
- name: Test with tox
|
||||||
run: pdm run tox
|
run: pdm run tox
|
||||||
|
|
|
@ -34,6 +34,7 @@ lint = [
|
||||||
"types-PyYAML>=6.0.12.11",
|
"types-PyYAML>=6.0.12.11",
|
||||||
"mypy>=1.5.1",
|
"mypy>=1.5.1",
|
||||||
"bandit[toml]>=1.7.5",
|
"bandit[toml]>=1.7.5",
|
||||||
|
"tox-pdm>=0.6.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.pylint.main]
|
[tool.pylint.main]
|
||||||
|
|
13
tox.ini
13
tox.ini
|
@ -1,6 +1,6 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = pylint, mypy, bandit, py{39,310,311,py39}
|
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]
|
[gh-actions]
|
||||||
python =
|
python =
|
||||||
|
@ -9,19 +9,26 @@ python =
|
||||||
3.11: py311
|
3.11: py311
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
groups = ; Dependency groups in pyproject.toml
|
groups =
|
||||||
dev
|
test
|
||||||
commands =
|
commands =
|
||||||
pytest --cov-report term-missing --cov-fail-under=100 --cov=operator_repo -v tests/
|
pytest --cov-report term-missing --cov-fail-under=100 --cov=operator_repo -v tests/
|
||||||
|
|
||||||
[testenv:pylint]
|
[testenv:pylint]
|
||||||
|
groups =
|
||||||
|
lint
|
||||||
commands =
|
commands =
|
||||||
pylint src
|
pylint src
|
||||||
|
|
||||||
[testenv:mypy]
|
[testenv:mypy]
|
||||||
|
groups =
|
||||||
|
test
|
||||||
|
lint
|
||||||
commands =
|
commands =
|
||||||
mypy --strict src tests
|
mypy --strict src tests
|
||||||
|
|
||||||
[testenv:bandit]
|
[testenv:bandit]
|
||||||
|
groups =
|
||||||
|
lint
|
||||||
commands =
|
commands =
|
||||||
bandit -c pyproject.toml -r .
|
bandit -c pyproject.toml -r .
|
||||||
|
|
Loading…
Reference in New Issue