diff --git a/.github/workflows/tox.yaml b/.github/workflows/tox.yaml index 090d86d..b66a9d0 100644 --- a/.github/workflows/tox.yaml +++ b/.github/workflows/tox.yaml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 9e29608..87f32d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] diff --git a/tox.ini b/tox.ini index 212a8ac..6947ef4 100644 --- a/tox.ini +++ b/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 .