Skip to content

Commit

Permalink
feat: setup codecoverage
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Mar 12, 2024
1 parent 0deeb5d commit 7b3221a
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 53 deletions.
98 changes: 46 additions & 52 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
os: [ubuntu-latest]
python-version: ["3.10.9"]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Pipenv install requirements and check it can be locked
run: |
pip install pipenv
pipenv --clear
time pipenv install --verbose --dev --skip-lock
time pipenv run pip install -e .[all]
time pipenv lock
- uses: actions/checkout@v2
- uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Pipenv install requirements and check it can be locked
run: |
pip install pipenv
pipenv --clear
time pipenv install --verbose --dev --skip-lock
time pipenv run pip install -e .[all]
time pipenv lock
linter_checks:
continue-on-error: False
Expand Down Expand Up @@ -66,42 +65,37 @@ jobs:
# - name: Documentation checks
# run: tox -e docs-block-check

# TODO
# test:
# continue-on-error: True
# needs:
# - lock_check
# - linter_checks
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest]
# python-version: ["3.8", "3.9", "3.10.9", "3.11"]
# timeout-minutes: 15
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
# fetch-depth: 0
# - uses: actions/setup-python@master
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install Dependencies
# run: |
# sudo apt-get update --fix-missing
# sudo apt-get autoremove
# sudo apt-get autoclean
# pip install --user --upgrade setuptools
# pip install tox==4.6.3
# - name: Unittests
# run: |
# tox -e unittests
# - if: matrix.python-version == '3.10.9'
# name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.xml
# flags: unittests
# name: codecov-umbrella
# fail_ci_if_error: false
test:
continue-on-error: True
needs:
- lock_check
- linter_checks
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10.9", "3.11"]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install --user --upgrade setuptools
pip install tox==4.6.3
- name: Unittests
run: |
tox -e unittests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: angrybayblade/ph7
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ __pycache__/
*.html

Pipfile.lock

.coverage
coverage.xml
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ ignore=
disable=R0801,R0903,C0103,C0114,R0401,W0622

[IMPORTS]
ignored-modules=bootstrap,django,black,requests
ignored-modules=bootstrap,django,black,requests,pytest
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,13 @@ deps =
commands =
python -m mkdocs serve

[testenv:unittests]
setenv =
PYTHONPATH={env:PWD:%CD%}
deps =
pytest==7.4.2
codecov==2.1.13
pytest-codecov==0.5.1
typing_extensions==4.10.0
commands =
pytest -v -rfE --doctest-modules ph7 tests/ --cov=ph7 --cov=examples --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs}

0 comments on commit 7b3221a

Please sign in to comment.