Skip to content

Switch both call sites from dynamic property access to NamedDomainObjectCollection.findByName(), which returns null safely, and fall back to conventional default paths when the java plugin is absent #1341

Switch both call sites from dynamic property access to NamedDomainObjectCollection.findByName(), which returns null safely, and fall back to conventional default paths when the java plugin is absent

Switch both call sites from dynamic property access to NamedDomainObjectCollection.findByName(), which returns null safely, and fall back to conventional default paths when the java plugin is absent #1341

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: '**'
pull_request:
branches: [ main ]
jobs:
# UNIX BUILDS
build-unix:
runs-on: ubuntu-latest
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: [26.0.0.4]
java: [21, 17, 25]
exclude:
- java: 8
RUNTIME: wlp
- java: 11
RUNTIME: ol
name: ${{ matrix.RUNTIME }} ${{ matrix.RUNTIME_VERSION }}, Java ${{ matrix.java }}, Linux
steps:
# Checkout repos
- name: Checkout ci.gradle
uses: actions/checkout@v3
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'semeru'
java-version: ${{ matrix.java }}
cache: 'gradle'
- 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
# Cache mvn/gradle packages
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Install dependencies
- name: Install ci.ant and ci.common
run: |
mvn -V clean install -f ci.ant --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests
mvn -V clean install -f ci.common --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests
# Run tests
- name: Run tests with Gradle on Ubuntu
run:
./gradlew clean install check -P"test.exclude"="**/DevContainerTest*,**/DevEarlyQuitTest*" -Druntime=${{ matrix.RUNTIME }} -DruntimeVersion="${{ matrix.RUNTIME_VERSION }}" --stacktrace --info --warning-mode=all
# Copy build reports and upload artifact if build failed
- name: Copy build/report/tests/test for upload
if: ${{ failure() }}
run: |
# Create the directory within the workspace
mkdir -p "${{ github.workspace }}/${{ env.BUILD_REPORTS_PATH }}"
# Copy the test results into that directory
cp -r test/* "${{ github.workspace }}/${{ env.BUILD_REPORTS_PATH }}"
working-directory: build/reports/tests
env:
BUILD_REPORTS_PATH: buildReports/${{ runner.os }}/java${{ matrix.java }}/${{ matrix.RUNTIME }}-${{ matrix.RUNTIME_VERSION }}
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: buildReportsArtifactLinux_${{matrix.java}}_${{matrix.RUNTIME}}_${{matrix.RUNTIME_VERSION}}
path: ${{ github.workspace }}/buildReports/
retention-days: 3
# WINDOWS BUILDS
build-windows:
runs-on: windows-latest
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: [26.0.0.4]
java: [21, 17, 25]
exclude:
- java: 8
RUNTIME: ol
- java: 11
RUNTIME: wlp
name: ${{ matrix.RUNTIME }} ${{ matrix.RUNTIME_VERSION }}, Java ${{ matrix.java }}, Windows
steps:
# Checkout repos
- name: Checkout ci.gradle
uses: actions/checkout@v3
# Set up Java
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'semeru'
java-version: ${{ matrix.java }}
cache: 'gradle'
# Moving and cloning to C: drive for Windows for more disk space
- name: Clone ci.ant, ci.common, ci.gradle repos to C drive
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
# Cache mvn/gradle packages
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Install ci.ant
- name: Install ci.ant
working-directory: ${{github.workspace}}/ci.ant
run: mvn -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
run: mvn -V clean install --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests
# Run tests
- name: Run tests with Gradle on Windows
working-directory: ${{github.workspace}}
# LibertyTest is excluded because test0_run hangs
run: ./gradlew clean install check -P"test.exclude"="**/Polling*,**/LibertyTest*,**/LibertyToolchainTest*,**/GenerateFeaturesTest*,**/TestSpringBootApplication*,**/DevContainerTest*,**/DevModeToolchainTest*,**/DevEarlyQuitTest*" -Druntime=${{ matrix.RUNTIME }} -DruntimeVersion="${{ matrix.RUNTIME_VERSION }}" --stacktrace --info --no-daemon
timeout-minutes: 75
# Copy build reports and upload artifact if build failed
- name: Copy build/report/tests/test for upload
if: ${{ failure() }}
working-directory: ${{github.workspace}}
run: cp -r build/reports/tests/test C:/buildReports/${{runner.os}}/java${{matrix.java}}/${{matrix.RUNTIME}}-${{matrix.RUNTIME_VERSION}}/
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: buildReportsArtifactWindows_${{matrix.java}}_${{matrix.RUNTIME}}_${{matrix.RUNTIME_VERSION}}
path: C:/buildReports
retention-days: 3