From a5aeb9a50d8705c12669123d9ca2f49136f6c410 Mon Sep 17 00:00:00 2001 From: matan Date: Thu, 24 Mar 2022 09:43:01 +0200 Subject: [PATCH] Workflow: Add code coverage. --- .github/workflows/python-app.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 86c3e81..5ab351d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -32,7 +32,16 @@ jobs: - name: Run tests run: | pip install pytest - python -m pytest + pip install pytest-cov + python -m pytest --cov=./ --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + directory: ./coverage/reports/ + files: ./coverage.xml + env_vars: OS,PYTHON + fail_ci_if_error: true + verbose: true - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names