From 9cc3c01d40dcdf515de3c9d6aa42e5643256a330 Mon Sep 17 00:00:00 2001 From: David Benn Date: Mon, 20 Apr 2026 02:42:54 +0000 Subject: [PATCH] added HTML coverage generation and GitHub Pages deployment On push to master, generates HTML coverage report and deploys to gh-pages branch for dashboard viewing. Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/unit-test.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index bffb5ad..3362dc1 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -1,6 +1,8 @@ name: Unit Tests on: + push: + branches: [ master ] pull_request: branches: [ master ] @@ -26,4 +28,19 @@ jobs: - name: Run tests with coverage run: | - pytest --cov=src/aquasense --cov-report=term --cov-branch + pytest --cov=src/aquasense --cov-report=term --cov-report=html:coverage-html --cov-branch + + - name: Deploy coverage to GitHub Pages + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git fetch origin gh-pages + git worktree add gh-pages-deploy gh-pages + rm -rf gh-pages-deploy/coverage + cp -r coverage-html gh-pages-deploy/coverage + cd gh-pages-deploy + git add -A + git diff --cached --quiet && exit 0 + git commit -m "update coverage report" + git push origin gh-pages