Skip to content

Commit

Permalink
Added separate coverage test
Browse files Browse the repository at this point in the history
  • Loading branch information
soxoj committed Dec 8, 2024
1 parent 8794b70 commit 1522d87
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/coverage-test.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 2 additions & 10 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
poetry run pytest --reruns 3 --reruns-delay 5

0 comments on commit 1522d87

Please sign in to comment.