Merge pull request #251 from apache/main_to_6.1.0-SNAPSHOT #176
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
| name: Auto JDK Matrix Test & Install | |
| on: | |
| push: | |
| paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ] | |
| branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ] | |
| pull_request: | |
| paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ] | |
| # The branches below must be a subset of the branches above | |
| branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ] | |
| workflow_dispatch: | |
| env: | |
| MAVEN_OPTS: -Xmx4g -Xms1g | |
| jobs: | |
| build: | |
| name: Build, Test, Install | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| jdk: [ 21 ] # LTS versions only | |
| os: [ ubuntu-latest ] | |
| include: | |
| # - os: windows-latest | |
| # skip_javadoc: "`-Dmaven`.javadoc`.skip=true" | |
| # skip_gpg: "`-Dgpg`.skip=true" | |
| - os: ubuntu-latest | |
| skip_javadoc: -Dmaven.javadoc.skip=true | |
| skip_gpg: -Dgpg.skip=true | |
| # - os: macos-latest | |
| # skip_javadoc: -Dmaven.javadoc.skip=true | |
| # skip_gpg: -Dgpg.skip=true | |
| runs-on: ${{matrix.os}} | |
| env: | |
| JDK_VERSION: ${{ matrix.jdk }} | |
| steps: | |
| - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: build-${{ runner.os }}-maven- | |
| - name: Install Matrix JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.jdk }} | |
| distribution: 'temurin' | |
| java-package: jdk | |
| architecture: x64 | |
| - name: Echo Java Version | |
| run: > | |
| java -version | |
| - name: Print Current workflow | |
| run: > | |
| cat .github/workflows/auto-jdk-matrix.yml | |
| - name: Test | |
| run: > | |
| mvn clean test -B | |
| -Dmaven.javadoc.skip=true | |
| -Dgpg.skip=true | |
| - name: Install | |
| run: > | |
| mvn clean install -B | |
| ${{matrix.os.skip_javadoc}} | |
| -DskipTests=true | |
| ${{matrix.os.skip_gpg}} | |
| # Architecture options: x86, x64, armv7, aarch64, ppc64le | |
| # setup-java@v4 has a "with cache" option | |
| # Lifecycle: validate, compile, test, package, verify, install, deploy | |
| # -B batch mode, never stops for user input | |
| # -V show Version without stopping | |
| # -X debug mode | |
| # -q quiet, only show errors |