feat!: credential detection, user-definable prompts, and a unified AI… #41
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Builds the MkDocs Material documentation site, Javadoc, JaCoCo coverage, PMD | |
| # static-analysis, and JUnit test reports, then assembles them under a single | |
| # site/ directory and deploys everything to GitHub Pages. | |
| # | |
| # Triggered only when a release tag (release@x.y.z) is pushed, so the public | |
| # documentation always matches a downloadable distribution artifact. | |
| # Manual dispatch is kept for emergency redeploys without a new tag. | |
| name: Pages | |
| on: | |
| push: | |
| tags: | |
| - 'release@*' | |
| workflow_dispatch: | |
| # Only one deployment at a time; cancel any in-progress run when a newer one starts. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| security-events: write # passed to the methodatlas-analysis reusable workflow | |
| jobs: | |
| # ------------------------------------------------------------------------- | |
| # Job 1: build all artifacts and assemble the site directory | |
| # ------------------------------------------------------------------------- | |
| build: | |
| name: Build reports | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # full history + all tags are required by com.palantir.git-version | |
| - name: Set up JDK 21 (Temurin) | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| build-scan-publish: true | |
| build-scan-terms-of-service-url: "https://gradle.com/help/legal-terms-of-use" | |
| build-scan-terms-of-service-agree: "yes" | |
| - name: Set up Node.js (required by TypeScript discovery plugin) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| # jacocoTestReport is a finalizer of the test task and runs automatically. | |
| - name: Run tests and generate JaCoCo report | |
| run: ./gradlew test | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: build/reports/jacoco/test/jacocoTestReport.xml | |
| fail_ci_if_error: false | |
| # PMD violations must not block the Pages deployment – the report itself | |
| # is the deliverable. The step is marked continue-on-error so a failed | |
| # PMD check still produces build/reports/pmd/main.html. | |
| - name: Run PMD static analysis | |
| run: ./gradlew pmdMain | |
| continue-on-error: true | |
| - name: Run SpotBugs analysis | |
| run: ./gradlew spotbugsMain | |
| continue-on-error: true | |
| - name: Generate Javadoc | |
| run: ./gradlew javadoc | |
| - name: Run PIT mutation testing | |
| run: ./gradlew pitest | |
| continue-on-error: true | |
| - name: Set up Python (for MkDocs) | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install MkDocs Material | |
| run: pip install mkdocs-material mkdocs-glightbox | |
| # ----------------------------------------------------------------------- | |
| # Build MkDocs site first (creates a fresh site/ directory), then copy | |
| # Java reports into subdirectories so relative links from the Reports page | |
| # resolve correctly at runtime. | |
| # ----------------------------------------------------------------------- | |
| - name: Build MkDocs site | |
| run: mkdocs build --strict | |
| - name: Copy Java reports into site/ | |
| run: | | |
| mkdir -p site/jacoco site/pmd site/spotbugs site/tests site/javadoc site/pitest site/jacoco-modules | |
| cp -r build/reports/jacoco/test/html/. site/jacoco/ | |
| cp -r build/reports/pmd/. site/pmd/ | |
| cp -r build/reports/spotbugs/. site/spotbugs/ 2>/dev/null || true | |
| cp -r build/reports/tests/test/. site/tests/ | |
| cp -r build/docs/javadoc/. site/javadoc/ | |
| cp -r build/reports/pitest/. site/pitest/ 2>/dev/null || true | |
| # Per-module JaCoCo HTML reports — one directory per Java subproject. | |
| # The per-module enforcement (see docs/quality-gates.md) generates a | |
| # separate report under each <module>/build/reports/jacoco/test/html. | |
| for module_dir in methodatlas-*/build/reports/jacoco/test/html; do | |
| if [ -d "$module_dir" ]; then | |
| module_name=$(echo "$module_dir" | cut -d/ -f1) | |
| mkdir -p "site/jacoco-modules/$module_name" | |
| cp -r "$module_dir"/. "site/jacoco-modules/$module_name/" | |
| fi | |
| done | |
| # Minimal index page so visitors can navigate the per-module reports. | |
| { | |
| echo '<!DOCTYPE html>' | |
| echo '<html lang="en"><head><meta charset="utf-8">' | |
| echo '<title>Per-module JaCoCo coverage</title>' | |
| echo '<style>body{font-family:system-ui,sans-serif;margin:2rem;max-width:48rem}' | |
| echo 'h1{margin-bottom:0.5rem}p{color:#555}a{display:block;padding:0.4rem 0}</style>' | |
| echo '</head><body>' | |
| echo '<h1>Per-module JaCoCo coverage</h1>' | |
| echo '<p>Each Java subproject enforces its own instruction-coverage floor.' | |
| echo 'See <a href="../quality-gates/">Quality Gates</a> for the full table.</p>' | |
| for module_dir in site/jacoco-modules/*/; do | |
| module_name=$(basename "$module_dir") | |
| echo "<a href=\"$module_name/index.html\">$module_name</a>" | |
| done | |
| echo '</body></html>' | |
| } > site/jacoco-modules/index.html | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site/ | |
| # ------------------------------------------------------------------------- | |
| # Job 2: MethodAtlas AI self-analysis (informational, never blocks deploy) | |
| # | |
| # Calls the reusable workflow in methodatlas-analysis.yml. The deploy job | |
| # (Job 3) declares needs: build — not needs: methodatlas-analysis — so a | |
| # failure here never prevents the Pages deployment from proceeding. | |
| # ------------------------------------------------------------------------- | |
| methodatlas-analysis: | |
| name: MethodAtlas self-analysis | |
| needs: build | |
| uses: ./.github/workflows/methodatlas-analysis.yml | |
| permissions: | |
| contents: read | |
| security-events: write | |
| models: read | |
| # ------------------------------------------------------------------------- | |
| # Job 3: deploy the uploaded artifact to GitHub Pages | |
| # ------------------------------------------------------------------------- | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |