From 6b04acfa17fd7545be845742489a194f6e3aac2f Mon Sep 17 00:00:00 2001 From: chainyo Date: Tue, 22 Aug 2023 08:08:02 +0200 Subject: [PATCH] improve ci + add coverage --- .github/workflows/ci-cd.yaml | 7 ++++++- pyproject.toml | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index f9c7f8c..a7bd764 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -16,6 +16,10 @@ on: types: - published +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: check-quality: runs-on: ubuntu-latest @@ -38,6 +42,7 @@ jobs: run: | black --check --diff --preview src tests ruff src tests + mypy src run-tests: needs: check-quality @@ -59,7 +64,7 @@ jobs: pip install ".[tests]" - name: run-tests - run: pytest tests/ -s --durations 0 + run: pytest --cov=REPLACE_PACKAGE_NAME --cov-report=term-missing tests/ -s --durations 0 deploy-docs: needs: run-tests diff --git a/pyproject.toml b/pyproject.toml index bbae3f6..603415f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ quality = [ ] tests = [ "pytest~=7.1.2", + "pytest-cov~=4.1", ] [tool.hatch.envs.quality] @@ -104,7 +105,7 @@ features = [ ] [tool.hatch.envs.tests.scripts] -run = "pytest tests/ --durations 0 -s" +run = "pytest --cov=REPLACE_PACKAGE_NAME --cov-report=term-missing tests/ --durations 0 -s" [[tool.hatch.envs.tests.matrix]] python = ["38", "39", "310", "311"]