Skip to content

Commit 2885f52

Browse files
committed
Pipeline - Run build and test on latest stable java version
1 parent 5328f3a commit 2885f52

File tree

2 files changed

+74
-10
lines changed

2 files changed

+74
-10
lines changed

.github/actions/common/action.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ inputs:
5151
free-space:
5252
description: Whether to aggressively free disk space on the runner
5353
default: 'false'
54+
setup-latest-java:
55+
description: Setup latest stable java version
56+
default: 'false'
57+
cache-key-prefix:
58+
description: Add a prefix to cache key
59+
default: ''
5460
runs:
5561
using: "composite"
5662
steps:
@@ -78,10 +84,18 @@ runs:
7884
check-for-updates: 'false'
7985
set-java-home: 'false'
8086
- name: Set up JDK
87+
if: ${{ inputs.setup-latest-java == 'false' }}
8188
uses: actions/[email protected]
8289
with:
8390
distribution: ${{ env.JAVA_DISTRO }}
8491
java-version: ${{ env.JAVA_VERSION }}
92+
- name: Set up JDK ea-stable
93+
if: ${{ inputs.setup-latest-java == 'true' }}
94+
uses: oracle-actions/setup-java@v1
95+
with:
96+
website: jdk.java.net
97+
release: ea
98+
version: stable
8599
- name: Cache local Maven repository (read-write)
86100
if: ${{ inputs.maven-cache == 'read-write' }}
87101
uses: actions/[email protected]
@@ -93,9 +107,9 @@ runs:
93107
!.m2/repository/io/helidon/**
94108
enableCrossOsArchive: true
95109
# only hash top-level poms to keep it fast
96-
key: local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }}
110+
key: ${{ inputs.cache-key-prefix }}local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }}
97111
restore-keys: |
98-
local-maven-
112+
${{ inputs.cache-key-prefix }}local-maven-
99113
- name: Cache local Maven repository (read-only)
100114
if: ${{ inputs.maven-cache == 'read-only' }}
101115
uses: actions/cache/[email protected]
@@ -104,9 +118,9 @@ runs:
104118
.m2/repository/**/*.*
105119
!.m2/repository/io/helidon/**
106120
enableCrossOsArchive: true
107-
key: local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }}
121+
key: ${{ inputs.cache-key-prefix }}local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }}
108122
restore-keys: |
109-
local-maven-
123+
${{ inputs.cache-key-prefix }}local-maven-
110124
- name: Build cache (read-write)
111125
if: ${{ inputs.build-cache == 'read-write' }}
112126
uses: actions/[email protected]
@@ -115,7 +129,7 @@ runs:
115129
./**/target/**
116130
.m2/repository/io/helidon/**
117131
enableCrossOsArchive: true
118-
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }}
132+
key: ${{ inputs.cache-key-prefix }}build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }}
119133
restore-keys: |
120134
build-cache-${{ github.run_id }}-${{ github.run_attempt }}-
121135
build-cache-${{ github.run_id }}-
@@ -128,10 +142,10 @@ runs:
128142
.m2/repository/io/helidon/**
129143
enableCrossOsArchive: true
130144
fail-on-cache-miss: true
131-
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }}
145+
key: ${{ inputs.cache-key-prefix }}build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }}
132146
restore-keys: |
133-
build-cache-${{ github.run_id }}-${{ github.run_attempt }}-
134-
build-cache-${{ github.run_id }}-
147+
${{ inputs.cache-key-prefix }}build-cache-${{ github.run_id }}-${{ github.run_attempt }}-
148+
${{ inputs.cache-key-prefix }}build-cache-${{ github.run_id }}-
135149
- name: Exec
136150
env:
137151
MVN_ARGS: |
@@ -150,7 +164,7 @@ runs:
150164
**/target/failsafe-reports/**
151165
**/target/it/**/*.log
152166
- name: Archive artifacts
153-
if: ${{ inputs.artifact-name != '' && inputs.artifact-path != '' && always() }}
167+
if: ${{ inputs.artifact-name != '' && inputs.artifact-path != '' && always() }}
154168
uses: actions/upload-artifact@v4
155169
with:
156170
if-no-files-found: 'ignore'

.github/workflows/validate.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
2+
# Copyright (c) 2023, 2025 Oracle and/or its affiliates.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -94,6 +94,56 @@ jobs:
9494
-DskipTests \
9595
-Ptests \
9696
install
97+
build-latest-java:
98+
timeout-minutes: 15
99+
runs-on: ubuntu-22.04
100+
steps:
101+
- uses: actions/checkout@v4
102+
with:
103+
ref: ${{ inputs.ref }}
104+
- uses: ./.github/actions/common
105+
with:
106+
build-cache: read-write
107+
maven-cache: read-write
108+
cache-key-prefix: latest-java-
109+
setup-latest-java: true
110+
run: |
111+
mvn ${MVN_ARGS} --version
112+
mvn ${MVN_ARGS} build-cache:go-offline
113+
mvn ${MVN_ARGS} -T8 \
114+
-Dorg.slf4j.simpleLogger.showThreadName=true \
115+
-DskipTests \
116+
-Ptests \
117+
install
118+
_tests-latest-java:
119+
needs: build-latest-java
120+
timeout-minutes: 30
121+
strategy:
122+
matrix:
123+
os: [ ubuntu-22.04, windows-2022 ]
124+
moduleSet: [ core, it, jpa, jpa-oracle, dbclient, dbclient-oracle, others ]
125+
include:
126+
- { os: ubuntu-22.04, platform: linux }
127+
- { os: windows-2022, platform: windows }
128+
runs-on: ${{ matrix.os }}
129+
name: tests/${{ matrix.moduleSet }}-${{matrix.platform}}-latest-java
130+
steps:
131+
- uses: actions/checkout@v4
132+
with:
133+
ref: ${{ inputs.ref }}
134+
- uses: ./.github/actions/common
135+
with:
136+
build-cache: read-only
137+
cache-key-prefix: latest-java-
138+
setup-latest-java: true
139+
test-artifact-name: tests-${{ matrix.moduleSet }}-${{ matrix.platform }}-latest-java
140+
run: |
141+
mvn --version
142+
mvn ${MVN_ARGS} \
143+
-DreactorRule=tests \
144+
-DmoduleSet=${{ matrix.moduleSet }} \
145+
-Dsurefire.reportNameSuffix=${{ matrix.platform }} \
146+
verify
97147
_tests:
98148
needs: build
99149
timeout-minutes: 30

0 commit comments

Comments
 (0)