docs: archetype context slimming - tiko-build spine + reference chunk… #621
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
| # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| name: Java CI with Maven | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| name: Build (JDK ${{ matrix.java }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java: [ '21', '25', '26' ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build with Maven | |
| run: mvn -B package --file pom.xml | |
| integration-test: | |
| name: Integration Tests (JDK ${{ matrix.java }}, Docker / Testcontainers) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java: [ '21', '26' ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Full history so SonarCloud can attribute new-code/blame accurately. | |
| fetch-depth: 0 | |
| - name: Set up JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| distribution: 'temurin' | |
| cache: maven | |
| # `install` (not `verify`) so the archetype IT — which spawns a sub-Maven | |
| # build that resolves `io.tiko:tiko-bom` from the local repo — sees the | |
| # parent BOM. With `verify` only, nothing is installed and the archetype IT | |
| # fails to find tiko-bom in central. | |
| - name: Run integration tests | |
| run: mvn -B install --file pom.xml | |
| # SonarCloud CI-based analysis, on the JDK 21 leg only (one analysis per build). Runs after | |
| # `install`, reusing the compiled classes + the JaCoCo aggregate from this same job — no | |
| # rebuild. Requires the SONAR_TOKEN secret and Automatic Analysis DISABLED in the SonarCloud | |
| # UI (the two analysis modes are mutually exclusive). Project key, org, host, coverage path, | |
| # and exclusions all come from the root pom's <properties>. | |
| - name: SonarCloud scan | |
| if: matrix.java == '21' | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: mvn -B sonar:sonar --file pom.xml | |
| # `install` runs the verify phase, so JaCoCo's per-module `report` and the aggregate | |
| # `report-aggregate` have produced their XML by now. Upload them so coverage tooling | |
| # (e.g. a future SonarCloud CI scanner) can consume them without re-running the build. | |
| - name: Upload JaCoCo coverage reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jacoco-coverage-jdk${{ matrix.java }} | |
| path: | | |
| **/target/site/jacoco/jacoco.xml | |
| tiko-coverage/target/site/jacoco-aggregate/jacoco.xml | |
| if-no-files-found: warn |