From c8538c1436eaf32d8a4cf90dee669ae74b46247a Mon Sep 17 00:00:00 2001 From: Vipul-Cariappa Date: Sat, 2 Dec 2023 14:20:34 +0530 Subject: [PATCH 1/2] added codecov --- .github/workflows/test.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6953014..c33eeca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,18 +20,22 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 mypy pylint + python -m pip install flake8 mypy pylint coverage if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 run: | flake8 ./tests/*.py ./logic/*.py --max-line-length=120 + - name: Lint with pylint continue-on-error: true run: | @@ -47,6 +51,13 @@ jobs: - name: Type checker with mypy run: | mypy ./tests/*.py ./logic/*.py + - name: Test with python unittest run: | - python -m unittest tests/*.py --verbose + coverage run -m unittest discover --verbose + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + From 7d8d5b165070197e7b30c9a33b0cc92c045ea644 Mon Sep 17 00:00:00 2001 From: Vipul-Cariappa Date: Sat, 2 Dec 2023 14:28:05 +0530 Subject: [PATCH 2/2] fix coverage of tests --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c33eeca..2753e5d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,7 @@ jobs: - name: Test with python unittest run: | - coverage run -m unittest discover --verbose + coverage run --omit="*/test*" -m unittest discover --verbose - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3