From 2ce413272ec367e1d20084566e2eb12e78e681e6 Mon Sep 17 00:00:00 2001 From: jbannon Date: Fri, 29 Apr 2022 07:33:52 +0000 Subject: [PATCH] try xml --- .github/workflows/build_lint_test.yaml | 13 ++++++------- tools/test | 12 ++++++++++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_lint_test.yaml b/.github/workflows/build_lint_test.yaml index 99c7db71..e92e708c 100644 --- a/.github/workflows/build_lint_test.yaml +++ b/.github/workflows/build_lint_test.yaml @@ -22,13 +22,12 @@ jobs: run: | pip install .[lint] ./tools/linter check - - name: Run tests with coverage + - name: Run tests run: | pip install .[test] - ./tools/test - - name: Upload test coverage - uses: actions/upload-artifact@v3 + ./tools/test xml + - name: Report coverage + uses: 5monkeys/cobertura-action@master with: - name: test-coverage - path: htmlcov/index.html - retention-days: 5 + path: coverage.xml + repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/tools/test b/tools/test index dd8711ae..10dd7ab9 100755 --- a/tools/test +++ b/tools/test @@ -1,2 +1,10 @@ -# Run within root folder. Runs tests with coverage, and reports it to html -coverage run -m pytest && coverage html +# Run within root directory + +if [ $1 = "html" ]; then + coverage run -m pytest && coverage html +elif [ $1 = "xml" ]; then + coverage run -m pytest && coverage xml +else + coverage run -m pytest && coverage report +fi +