From 60c3447d2dae8034c087cc84f51ddbdae7ac1753 Mon Sep 17 00:00:00 2001 From: Igor Fedoronchuk Date: Thu, 19 Feb 2026 19:48:26 +0100 Subject: [PATCH] Deploy JaCoCo coverage report to GitHub Pages Add deploy-coverage job that publishes the HTML coverage report to GitHub Pages on pushes to main. Reuses the artifact from the test job to avoid a duplicate build. --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 399abb5..f5bd43c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,11 @@ on: pull_request: workflow_dispatch: +permissions: + contents: read + pages: write + id-token: write + jobs: test: runs-on: ubuntu-latest @@ -89,3 +94,30 @@ jobs: path: | build/reports/tests/test build/test-results/test + + deploy-coverage: + needs: test + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Download coverage report + uses: actions/download-artifact@v4 + with: + name: jacoco-html-report + path: coverage + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: coverage + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4