From 623d4b9567646b4210a66a4b018b5360c8f8074c Mon Sep 17 00:00:00 2001 From: Briar Date: Tue, 19 Nov 2024 18:08:35 -0500 Subject: [PATCH] Add coverage file, update test yml --- .coveragerc | 14 ++++++++++++++ .github/workflows/run-python-tests.yml | 21 ++++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) create mode 100755 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100755 index 0000000..b023cda --- /dev/null +++ b/.coveragerc @@ -0,0 +1,14 @@ +[run] +relative_files = True + +[report] +omit = + */run.py + */python?.?/* + */venv/* + */site-packages/* + */tests/* + *__init__* + +exclude_lines = + if __name__ == '__main__': diff --git a/.github/workflows/run-python-tests.yml b/.github/workflows/run-python-tests.yml index bf05f53..a2d05dd 100644 --- a/.github/workflows/run-python-tests.yml +++ b/.github/workflows/run-python-tests.yml @@ -2,18 +2,25 @@ name: Run tests -on: [push, pull_request] +on: + workflow_dispatch: # add run button in github + push: + branches-ignore: + - gh-pages + pull_request: + branches-ignore: + - gh-pages jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.12 - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.x' - name: Install GDAL run: | sudo apt-get update @@ -34,11 +41,11 @@ jobs: run: | pytest --junitxml=junit/test-results.xml --cov-config .coveragerc --cov-report= --cov=. - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v1.6 + uses: EnricoMi/publish-unit-test-result-action@v2 if: always() with: github_token: ${{ secrets.GITHUB_TOKEN }} - files: junit/*.xml + junit_files: .tox/*.xml - name: Publish in Coveralls uses: AndreMiras/coveralls-python-action@develop if: success()