diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 0f518aad..264aac77 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,9 +1,10 @@ name: Docs on: - push: - branches: - - main + workflow_run: + workflows: ["QualityChecks"] # must match the name in ci.yml + types: [completed] + branches: [main] jobs: docs: @@ -37,10 +38,21 @@ jobs: mv $TMP_DIR docs ls -all docs touch docs/.nojekyll + - name: Download coverage artifact + uses: dawidd6/action-download-artifact@v11 + with: + workflow: quality-checks.yaml + workflow_conclusion: success + branch: main + github_token: ${{secrets.GITHUB_TOKEN}} + name: coverage + path: docs - name: Push to GitHub run: | git add . git add -f docs/autoapi/* + git add -f docs/coverage.xml + git add -f docs/coverage_html/* git config --global user.email "none" git config --global user.name "github-actions-bot" git commit -m "build documentation [ci skip]" diff --git a/.github/workflows/quality-checks.yaml b/.github/workflows/quality-checks.yaml index b82577bf..98067c01 100644 --- a/.github/workflows/quality-checks.yaml +++ b/.github/workflows/quality-checks.yaml @@ -35,3 +35,17 @@ jobs: #---------------------------------------------- - name: Run tests run: UV_PYTHON=python${{ matrix.python-version }} make test + - name: Create badge + run: | + uv pip install genbadge[coverage] + uv run genbadge coverage -i coverage.xml -o coverage.svg + - name: Uploade coverage artifact + if: matrix.python-version == '3.11' + uses: actions/upload-artifact@v5 + with: + name: coverage + path: | + coverage_html/** + coverage.svg + retention-days: 1 + overwrite: true diff --git a/Makefile b/Makefile index b271bbb4..d1a21268 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ lint: sync @echo -e "$(SUCCESS)Lint done$(RESET)" test: sync ## Run the tests, start with the failing ones and break on first fail. - @$(UV_RUN) pytest -v -x --ff -rN -Wignore -s --tb=short --durations=0 --cov --cov-report=xml tests + @$(UV_RUN) pytest -v -x --ff -rN -Wignore -s --tb=short --durations=0 --cov --cov-report=xml --cov-report=html:coverage_html tests @$(UV_RUN) pytest --nbmake --nbmake-kernel=python3 --durations=0 --nbmake-timeout=1000 --ignore=notebooks/frontends/GPJax.ipynb notebooks/ @if [ "$(UV_PYTHON)" = "python3.9" ]; then \ echo "Skipping GPJax notebook on python3.9"; \ diff --git a/README.md b/README.md index 22b4394a..43b0fe75 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # GeometricKernels [![Quality checks and Tests](https://github.com/geometric-kernels/GeometricKernels/actions/workflows/quality-checks.yaml/badge.svg)](https://github.com/geometric-kernels/GeometricKernels/actions/workflows/quality-checks.yaml) +[![coverage](https://geometric-kernels.github.io/GeometricKernels/coverage.svg?dummy=8484744)](https://geometric-kernels.github.io/GeometricKernels/coverage_html/index.html) [![Documentation](https://github.com/geometric-kernels/GeometricKernels/actions/workflows/docs.yaml/badge.svg)](https://geometric-kernels.github.io/GeometricKernels/index.html) [![Landing Page](https://img.shields.io/badge/Landing_Page-informational)](https://geometric-kernels.github.io/)