| # | |
| # Copyright (c) 2021, 2026 Contributors to the Eclipse Foundation | |
| # | |
| # This program and the accompanying materials are made available under the | |
| # terms of the Eclipse Public License v. 2.0 which is available at | |
| # http://www.eclipse.org/legal/epl-2.0, | |
| # or the Eclipse Distribution License v. 1.0 which is available at | |
| # http://www.eclipse.org/org/documents/edl-v10.php. | |
| # | |
| # SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | |
| # | |
| name: Java CI with Maven | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - '*-BRANCH' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| - '*-BRANCH' | |
| concurrency: | |
| group: ${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| java-version: [ '17', '21', '25' ] | |
| name: Test on JDK ${{ matrix.java-version }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build project | |
| run: mvn -B -V -U -C clean package | |
| - name: Verify TCK Distribution | |
| run: | | |
| # Unzip tck-dist zip | |
| TCK_UNZIP=tck-dist/target/tck-unzipped | |
| mkdir -p "$TCK_UNZIP" | |
| unzip -q "$(ls tck-dist/target/*.zip)" -d "$TCK_UNZIP" | |
| # Find TCK directory | |
| TCK_VERSIONED_ROOT=$(find "$TCK_UNZIP" -mindepth 1 -maxdepth 1 -type d) | |
| # Run artifact-install | |
| "$TCK_VERSIONED_ROOT/artifacts/artifact-install.sh" | |
| # Verify pom.xml and sub-modules are valid | |
| mvn -B -V -f "$TCK_VERSIONED_ROOT/bin/pom.xml" clean validate |