diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..3c420d5 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,21 @@ +[run] +# include = */src/* +# omit anything in a virtualenv directory anywhere +omit = + /home/travis/virtualenv/* + *.yml + /home/travis/img/* + __init__* + *.md + docs/* + venv/* + *.gif + *.html + /tests/* + +[report] +; Regexes for lines to exclude from consideration + +exclude_also = + ; Don't complain if non-runnable code isn't run: + if __name__ == .__main__.: \ No newline at end of file diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..075ac9d --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,46 @@ +--- +name: Codecov Coverage Report + +on: # yamllint disable-line rule:truthy + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: ["3.12"] + steps: + - uses: actions/checkout@main + - name: Setup Python + uses: actions/setup-python@main + with: + python-version: ${{ matrix.python-version }} + - name: Install prerequisites + run: | + python -m pip install --upgrade pip setuptools wheel + pip install -r requirements.txt + - name: Install pytest, pytest-cov + run: | + pip install pytest + pip install pytest-cov + - name: Generate coverage report + # yamllint disable rule:line-length + run: | + python -c "import os; print(os.getcwd())" + python -m pytest . --ignore=solutions --log-cli-level=INFO -v --cov-report term-missing --cov --cov-branch --cov-report=xml + - name: List test files + run: | + ls *.xml + # yamllint enable rule:line-length + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5.5.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false)cd \ No newline at end of file diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..1096048 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +pythonpath = . +junit_duration_report = call +python_files = *.py \ No newline at end of file