From 1522d870f83e904eeb4ef7f8dedd597ee39ed574 Mon Sep 17 00:00:00 2001 From: Soxoj Date: Sun, 8 Dec 2024 01:59:45 +0100 Subject: [PATCH] Added separate coverage test --- .github/workflows/coverage-test.yml | 31 ++++++++++++++++++++++++++++ .github/workflows/python-package.yml | 12 ++--------- 2 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/coverage-test.yml diff --git a/.github/workflows/coverage-test.yml b/.github/workflows/coverage-test.yml new file mode 100644 index 00000000..4bfec950 --- /dev/null +++ b/.github/workflows/coverage-test.yml @@ -0,0 +1,31 @@ +name: Linting and testing + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + types: [opened, synchronize, reopened] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install poetry + python -m poetry install --with dev + - name: Test with Coverage and Pytest (Fail if coverage is low) + run: | + coverage run --source=./maigret -m pytest tests + # Fail if coverage is less than 60% + coverage report --fail-under=60 + coverage html + - name: Upload coverage report + uses: actions/upload-artifact@v3 + with: + name: htmlcov + path: htmlcov \ No newline at end of file diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4be6ea5c..c3276b6a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -25,16 +25,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install poetry coverage + python -m pip install poetry python -m poetry install --with dev - name: Test with Coverage and Pytest (Fail if coverage is low) run: | - python -m coverage run -m pytest --reruns 3 --reruns-delay 5 - # Fail if coverage is less than 60% - python -m coverage report --fail-under=60 - python -m coverage html - - name: Upload coverage report - uses: actions/upload-artifact@v3 - with: - name: htmlcov - path: htmlcov \ No newline at end of file + poetry run pytest --reruns 3 --reruns-delay 5