| name: Java CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| contents: read | |
| env: | |
| MAVEN_VERSION: 3.9.15 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| java: | |
| - '21' | |
| - '25' | |
| - '26' | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup Temurin JDK | |
| uses: actions/setup-java@v6.2.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| # Puppeteer brings its own Chrome; only Chrome's shared libraries are needed here. | |
| - name: Install headless Chrome's dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| ca-certificates \ | |
| fonts-freefont-ttf \ | |
| fonts-ipafont-gothic \ | |
| fonts-kacst \ | |
| fonts-liberation \ | |
| fonts-thai-tlwg \ | |
| fonts-wqy-zenhei \ | |
| libasound2t64 \ | |
| libatk-bridge2.0-0t64 \ | |
| libatk1.0-0t64 \ | |
| libc6 \ | |
| libcairo2 \ | |
| libcups2t64 \ | |
| libdbus-1-3 \ | |
| libdrm2 \ | |
| libexpat1 \ | |
| libgbm1 \ | |
| libglib2.0-0t64 \ | |
| libgtk-3-0t64 \ | |
| libnspr4 \ | |
| libnss3 \ | |
| libpango-1.0-0 \ | |
| libvulkan1 \ | |
| libx11-6 \ | |
| libxcb1 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxext6 \ | |
| libxfixes3 \ | |
| libxkbcommon0 \ | |
| libxrandr2 \ | |
| xdg-utils | |
| - name: Install Maven | |
| run: | | |
| wget --retry-connrefused --tries=5 --waitretry=5 --read-timeout=20 --timeout=15 https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz | |
| tar -xzf apache-maven-${MAVEN_VERSION}-bin.tar.gz | |
| - name: Cache Maven packages | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2 | |
| - name: Build with Maven | |
| run: | | |
| java -version | |
| ./apache-maven-${MAVEN_VERSION}/bin/mvn --show-version \ | |
| clean verify -Pjs-test \ | |
| ${{ matrix.java == '21' && '-Pcoverage' || '' }} | |
| # Fails if the measurement itself has broken - for instance if a future | |
| # <argLine> override drops the @{jacoco.argLine} placeholder, which would | |
| # silently zero a module's coverage rather than failing the build. | |
| - name: Check coverage report | |
| if: matrix.java == '21' | |
| run: python3 .github/scripts/check-coverage-report.py | |
| # Coverage is measured on one JDK only: a single number is all that is needed, | |
| # and this leaves the other legs' timings untouched. The aggregated report is | |
| # produced by the wicket-coverage module; see the 'coverage' profile in pom.xml. | |
| - name: Upload coverage to Codecov | |
| # v7.0.0 - external actions must be pinned to a commit SHA: | |
| # https://infra.apache.org/github-actions-policy.html | |
| uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 | |
| if: matrix.java == '21' && github.repository_owner == 'apache' | |
| with: | |
| files: ./wicket-coverage/target/site/jacoco-aggregate/jacoco.xml | |
| # Empty for pull requests from forks, which upload tokenlessly. Do NOT switch | |
| # to pull_request_target to get at the secret; ASF policy forbids it. | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| disable_search: true |