From 7ff0aff70aa9ab102feb086a827c9703e2d838d5 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 24 Jun 2022 20:47:23 +0200 Subject: [PATCH] ci: report pytest coverage in PR via codecov Fixes: #1915 --- .github/workflows/_python.yml | 6 ++++++ tools/python.mk | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_python.yml b/.github/workflows/_python.yml index 3bc46c25f..de281d98e 100644 --- a/.github/workflows/_python.yml +++ b/.github/workflows/_python.yml @@ -77,3 +77,9 @@ jobs: - name: Test run: make test working-directory: ${{ inputs.context }} + + - name: Report coverage + uses: codecov/codecov-action@v3 + with: + files: ${{ inputs.context }}/coverage.xml + name: ${{ inputs.context }} diff --git a/tools/python.mk b/tools/python.mk index b5ac7943b..be109f21b 100644 --- a/tools/python.mk +++ b/tools/python.mk @@ -63,7 +63,7 @@ install: $(VENV) .PHONY: .pytest .pytest: $(VENV) source $(VENV)/bin/activate - pytest -n $(CPU_CORES) --color=yes -v $(PYTEST_ARG) + pytest -n $(CPU_CORES) --color=yes -v --cov-report term --cov-report xml:./coverage.xml $(PYTEST_ARG) .PHONY: .clean .clean: