Merge pull request #1951 from venmanyarun/package_archive_path_fix #1800
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 | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
| name: Java CI with Maven | |
| on: | |
| push: | |
| branches: '**' | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| # server-config-props-it fix | |
| MAVEN_HOME: $(which mvn) | |
| jobs: | |
| # UNIX BUILDS | |
| build-unix: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 130 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # test against latest update of each major Java version, as well as specific updates of LTS versions: | |
| RUNTIME: [ol, wlp] | |
| RUNTIME_VERSION: [25.0.0.9,25.0.0.10] | |
| java: [25, 21, 17, 11, 8] | |
| exclude: | |
| - java: 8 | |
| RUNTIME: wlp | |
| - java: 17 | |
| RUNTIME: wlp | |
| - java: 11 | |
| RUNTIME: ol | |
| - java: 21 | |
| RUNTIME: ol | |
| - RUNTIME_VERSION: 25.0.0.9 | |
| java: 25 | |
| - RUNTIME_VERSION: 25.0.0.10 | |
| java: 21 | |
| - RUNTIME_VERSION: 25.0.0.10 | |
| java: 17 | |
| - RUNTIME_VERSION: 25.0.0.10 | |
| java: 11 | |
| - RUNTIME_VERSION: 25.0.0.10 | |
| java: 8 | |
| name: ${{ matrix.RUNTIME }} ${{ matrix.RUNTIME_VERSION }}, Java ${{ matrix.java }}, Linux | |
| steps: | |
| # Checkout repos | |
| - name: Checkout ci.maven | |
| uses: actions/checkout@v3 | |
| - name: Pre-install JDK 8 (If Not Matrix Version) | |
| if: ${{ matrix.java != '8' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'temurin' | |
| - name: Pre-install JDK 11 (If Not Matrix Version) | |
| if: ${{ matrix.java != '11' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '11' | |
| distribution: 'temurin' | |
| - name: Pre-install JDK 17 (If Not Matrix Version) | |
| if: ${{ matrix.java != '17' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Pre-install JDK 21 (If Not Matrix Version) | |
| if: ${{ matrix.java != '21' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Pre-install JDK 25 (If Not Matrix Version) | |
| if: ${{ matrix.java != '25' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Setup Java ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| cache: 'maven' | |
| - name: Verify JAVA_HOME and Installed JDKs | |
| run: | | |
| echo "Primary JAVA_HOME is set to: $JAVA_HOME" | |
| java -version | |
| - name: Free disk space ubuntu | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: false | |
| large-packages: false | |
| - name: Verify ~/.m2/toolchains.xml content | |
| run: | | |
| echo "Checking for toolchains.xml in: $HOME/.m2/" | |
| ls -l $HOME/.m2/toolchains.xml 2> /dev/null || echo "File does not exist or permission denied." | |
| echo "--- toolchains.xml content ---" | |
| if [ -f $HOME/.m2/toolchains.xml ]; then | |
| cat $HOME/.m2/toolchains.xml | |
| else | |
| echo "Cannot display content: $HOME/.m2/toolchains.xml not found." | |
| fi | |
| echo "----------------------------" | |
| - name: Checkout ci.common | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: OpenLiberty/ci.common | |
| path: ci.common | |
| - name: Checkout ci.ant | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: OpenLiberty/ci.ant | |
| path: ci.ant | |
| - name: Set up Maven | |
| uses: stCarolas/[email protected] | |
| with: | |
| maven-version: 3.9.9 | |
| # Install dependencies | |
| - name: Install ci.ant and ci.common | |
| timeout-minutes: 15 | |
| run: | | |
| ./mvnw -V clean install -f ci.ant --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests | |
| ./mvnw -V clean install -f ci.common --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests | |
| # Run tests that require a minimum of Java 17 or later | |
| - name: Run tests that require a minimum of Java 17 or later | |
| if: ${{ matrix.java != '8' && matrix.java != '11'}} | |
| timeout-minutes: 20 | |
| run: ./mvnw -V verify --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -Ponline-its -D"invoker.streamLogsOnFailures"=true -D"invoker.test"="*setup*,*springboot-3-*,*compile-jsp-source-17-*" -Druntime=${{ matrix.RUNTIME }} -DruntimeVersion="${{ matrix.RUNTIME_VERSION }}" | |
| # Run tests | |
| - name: Run tests | |
| timeout-minutes: 90 | |
| run: ./mvnw -V verify --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -Ponline-its -D"invoker.streamLogsOnFailures"=true -Druntime=${{ matrix.RUNTIME }} -DruntimeVersion="${{ matrix.RUNTIME_VERSION }}" | |
| # WINDOWS BUILD | |
| build-windows: | |
| runs-on: windows-latest | |
| timeout-minutes: 170 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # test against latest update of each major Java version, as well as specific updates of LTS versions: | |
| RUNTIME: [ol, wlp] | |
| RUNTIME_VERSION: [ 25.0.0.9,25.0.0.10 ] | |
| java: [ 25, 21, 17, 11, 8 ] | |
| exclude: | |
| - java: 8 | |
| RUNTIME: wlp | |
| - java: 17 | |
| RUNTIME: wlp | |
| - java: 11 | |
| RUNTIME: ol | |
| - java: 21 | |
| RUNTIME: ol | |
| - RUNTIME_VERSION: 25.0.0.9 | |
| java: 25 | |
| - RUNTIME_VERSION: 25.0.0.10 | |
| java: 21 | |
| - RUNTIME_VERSION: 25.0.0.10 | |
| java: 17 | |
| - RUNTIME_VERSION: 25.0.0.10 | |
| java: 11 | |
| - RUNTIME_VERSION: 25.0.0.10 | |
| java: 8 | |
| name: ${{ matrix.RUNTIME }} ${{ matrix.RUNTIME_VERSION }}, Java ${{ matrix.java }}, Windows | |
| steps: | |
| # Checkout repos | |
| - name: Checkout ci.maven | |
| uses: actions/checkout@v3 | |
| - name: Pre-install JDK 8 (If Not Matrix Version) | |
| if: ${{ matrix.java != '8' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'temurin' | |
| - name: Pre-install JDK 11 (If Not Matrix Version) | |
| if: ${{ matrix.java != '11' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '11' | |
| distribution: 'temurin' | |
| - name: Pre-install JDK 17 (If Not Matrix Version) | |
| if: ${{ matrix.java != '17' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Pre-install JDK 21 (If Not Matrix Version) | |
| if: ${{ matrix.java != '21' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Pre-install JDK 25 (If Not Matrix Version) | |
| if: ${{ matrix.java != '25' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Setup Java ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| cache: 'maven' | |
| - name: Verify JAVA_HOME and Installed JDKs | |
| run: | | |
| echo "Primary JAVA_HOME is set to: $JAVA_HOME" | |
| java -version | |
| - name: Verify ~/.m2/toolchains.xml content | |
| shell: bash | |
| run: | | |
| echo "Checking for toolchains.xml in: $HOME/.m2/" | |
| ls -l $HOME/.m2/toolchains.xml 2> /dev/null || echo "File does not exist or permission denied." | |
| echo "--- toolchains.xml content ---" | |
| if [ -f $HOME/.m2/toolchains.xml ]; then | |
| cat $HOME/.m2/toolchains.xml | |
| else | |
| echo "Cannot display content: $HOME/.m2/toolchains.xml not found." | |
| fi | |
| echo "----------------------------" | |
| # Clone to same github workspace used for ci.maven checkout | |
| - name: Clone ci.ant and ci.common repos to github.workspace | |
| run: | | |
| echo ${{github.workspace}} | |
| git clone https://github.com/OpenLiberty/ci.common.git ${{github.workspace}}/ci.common | |
| git clone https://github.com/OpenLiberty/ci.ant.git ${{github.workspace}}/ci.ant | |
| - name: Set up Maven | |
| uses: stCarolas/[email protected] | |
| with: | |
| maven-version: 3.9.9 | |
| # Install ci.ant | |
| - name: Install ci.ant | |
| working-directory: ${{github.workspace}}/ci.ant | |
| timeout-minutes: 15 | |
| run: .\mvnw.cmd -V clean install --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests | |
| # Install ci.common | |
| - name: Install ci.common | |
| working-directory: ${{github.workspace}}/ci.common | |
| timeout-minutes: 15 | |
| run: .\mvnw.cmd -V clean install --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests | |
| # Run tests that require a minimum of Java 17 or later | |
| - name: Run tests that require a minimum of Java 17 or later | |
| working-directory: ${{github.workspace}} | |
| if: ${{ matrix.java != '8' && matrix.java != '11'}} | |
| timeout-minutes: 45 | |
| run: .\mvnw.cmd -V verify -Ponline-its --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -D"invoker.streamLogsOnFailures"=true -D"invoker.test"="*setup*,*springboot-3-*,*compile-jsp-source-17-*" -Druntime=${{ matrix.RUNTIME }} -DruntimeVersion="${{ matrix.RUNTIME_VERSION }}" | |
| # Run tests | |
| - name: Run tests | |
| working-directory: ${{github.workspace}} | |
| timeout-minutes: 90 | |
| run: .\mvnw.cmd -V verify -Ponline-its --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -D"invoker.streamLogsOnFailures"=true -Druntime=${{ matrix.RUNTIME }} -DruntimeVersion="${{ matrix.RUNTIME_VERSION }}" |