From a3226e78efff1fc65af8d823c726610792e52c8c Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 8 Oct 2024 15:16:23 -0300 Subject: [PATCH 1/5] Add codecov action --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fd7e71c..bd4a6da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,3 +34,6 @@ jobs: python-version: ${{ matrix.python-version }} - run: python -m pip install tox - run: tox -f py$(echo ${{ matrix.python-version }} | tr -d .) + - uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} From 8c88841146d0bdb326cd977907130fe28e6891d6 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 8 Oct 2024 15:19:02 -0300 Subject: [PATCH 2/5] Generate XML coverage report --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6370da3..726ab3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ build-backend = "setuptools.build_meta" write_to = "drf_excel/_version.py" [tool.pytest.ini_options] -addopts = "--cov --cov-report=html --cov-report=term" +addopts = "--cov --cov-report=xml --cov-report=term" python_files = "tests.py test_*.py" DJANGO_SETTINGS_MODULE = "tests.settings" From 9a946c918e43e6cad73fb558dcbc47eaba77f78e Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 8 Oct 2024 15:19:51 -0300 Subject: [PATCH 3/5] Only run on pushes to main branch --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd4a6da..973b610 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,8 @@ name: CI on: pull_request: push: + branches: + - main jobs: lint: From d2e0f8476eee6aa0eb8638ca273e061ecc99ca77 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 8 Oct 2024 15:26:59 -0300 Subject: [PATCH 4/5] Add coverage badge to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a3e9bb1..db5117b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # DRF Excel: Django REST Framework Excel Spreadsheet (xlsx) Renderer +[![codecov](https://codecov.io/gh/wharton/drf-excel/graph/badge.svg?token=EETTI9XRNO)](https://codecov.io/gh/wharton/drf-excel) + `drf-excel` provides an Excel spreadsheet (xlsx) renderer for Django REST Framework. It uses OpenPyXL to create the spreadsheet and provide the file to the end user. ## Requirements From 681b13c83956c2d3a9b9afc6cd4993b1cf51733a Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 8 Oct 2024 15:50:37 -0300 Subject: [PATCH 5/5] Ignore coverage.xml in git --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a08d37b..b2ae8c5 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ Desktop.ini # Coverage htmlcov/ .coverage +coverage.xml