From 8c36b54fccf838681978a7bbba71ff6ca82e6c21 Mon Sep 17 00:00:00 2001 From: Gonzalo Casas Date: Sat, 29 Jun 2024 13:37:32 +0200 Subject: [PATCH 1/3] Added code coverage report uploads to codecov.io --- .github/workflows/coverage.yml | 31 +++++++++++++++++++++++++++++++ CHANGELOG.md | 2 ++ requirements-dev.txt | 1 + 3 files changed, 34 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000000..98440bfd323 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,31 @@ +name: coverage + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')" + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python: ["3.12"] + + steps: + - uses: compas-dev/compas-actions.build@v4 + with: + invoke_lint: false + invoke_test: false + python: ${{ matrix.python }} + - name: Run tests collecting coverage reports + run: pytest --cov src/compas --cov-report=html + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index cfcc7733534..ecedc08e582 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +* Added code coverage report uploads to codecov.io. + ### Changed * Fixed bug in `compas.geometry.curves.curve.Curve.reversed` by adding missing parenthesis. diff --git a/requirements-dev.txt b/requirements-dev.txt index a1579931b3b..015af37c147 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,6 +3,7 @@ black >=22.12.0 bump-my-version compas_invocations2 invoke >=0.14 +pytest-cov ruff sphinx_compas2_theme twine From 6ff926cca984d1b32f0064e2fc179f43414da189 Mon Sep 17 00:00:00 2001 From: Gonzalo Casas Date: Sat, 29 Jun 2024 13:43:19 +0200 Subject: [PATCH 2/3] Fix workflow name --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 98440bfd323..2b37aa76841 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -9,7 +9,7 @@ on: - main jobs: - build: + coverage: if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')" runs-on: ${{ matrix.os }} strategy: From fdaec516a2f8184a58c4a33dada46242147ae53a Mon Sep 17 00:00:00 2001 From: Gonzalo Casas Date: Sat, 29 Jun 2024 13:52:48 +0200 Subject: [PATCH 3/3] Add badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 45ab7c06109..8b2360d7c49 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # The COMPAS framework ![build](https://github.com/compas-dev/compas/workflows/build/badge.svg) +[![codecov](https://codecov.io/github/compas-dev/compas/graph/badge.svg?token=wpkfew9szQ)](https://codecov.io/github/compas-dev/compas) [![GitHub - License](https://img.shields.io/github/license/compas-dev/compas.svg)](https://github.com/compas-dev/compas) [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/compas)](https://anaconda.org/conda-forge/compas) [![pip downloads](https://img.shields.io/pypi/dm/compas)](https://pypi.python.org/project/COMPAS)