From cd2e3288d28d23556a81bad76dab0aae2e055ac2 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 1 Jun 2021 12:30:40 +0200 Subject: ci: Fix code coverage reporting for web API This change updates the build workflow to properly report the code coverage reports of the web API to Codecov. --- .github/workflows/build.yml | 6 +++--- opendc-web/opendc-web-api/.coveragerc | 5 +++++ opendc-web/opendc-web-api/.gitignore | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 opendc-web/opendc-web-api/.coveragerc diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c42e638..b0e8cc38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,19 +78,19 @@ jobs: - name: Lint with pylint run: ./check.sh - name: Test with pytest - run: pytest --cov=opendc/ --junitxml=.junit-report.xml + run: pytest --cov --cov-report=xml --junitxml=junit-report.xml - name: Publish report if: always() uses: mikepenz/action-junit-report@v2 with: check_name: test (Python ${{ matrix.python }}) - report_paths: '**/.junit-report.xml' + report_paths: '**/junit-report.xml' github_token: ${{ secrets.GITHUB_TOKEN }} - name: Upload code coverage uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} - files: opendc-web/opendc-web-api/.coverage + files: opendc-web/opendc-web-api/coverage.xml flags: api build-ui: name: Build UI (Node ${{ matrix.node }}) diff --git a/opendc-web/opendc-web-api/.coveragerc b/opendc-web/opendc-web-api/.coveragerc new file mode 100644 index 00000000..55d99c2e --- /dev/null +++ b/opendc-web/opendc-web-api/.coveragerc @@ -0,0 +1,5 @@ +[run] +source = . +omit = + tests/* + conftest.py diff --git a/opendc-web/opendc-web-api/.gitignore b/opendc-web/opendc-web-api/.gitignore index b0390689..9f8dfc5c 100644 --- a/opendc-web/opendc-web-api/.gitignore +++ b/opendc-web/opendc-web-api/.gitignore @@ -15,4 +15,5 @@ config.json test.json .env* .coverage -.junit-report.xml +coverage.xml +junit-report.xml -- cgit v1.2.3