diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ee338fc..314dc6f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -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 @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6f0824a..7ba87af 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ __pycache__/ *.html Pipfile.lock + +.coverage +coverage.xml \ No newline at end of file diff --git a/.pylintrc b/.pylintrc index d12a4da..e123205 100644 --- a/.pylintrc +++ b/.pylintrc @@ -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 diff --git a/tox.ini b/tox.ini index ef8e355..ee8fc3e 100644 --- a/tox.ini +++ b/tox.ini @@ -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}