Skip to content

Commit 0684cf0

Browse files
committed
Pipeline - Run build and test on latest stable java version
1 parent b0750a8 commit 0684cf0

File tree

2 files changed

+103
-9
lines changed

2 files changed

+103
-9
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:
@@ -87,10 +93,18 @@ runs:
8793
check-for-updates: 'false'
8894
set-java-home: 'false'
8995
- name: Set up JDK
96+
if: ${{ inputs.setup-latest-java == 'false' }}
9097
uses: actions/[email protected]
9198
with:
9299
distribution: ${{ env.JAVA_DISTRO }}
93100
java-version: ${{ env.JAVA_VERSION }}
101+
- name: Set up JDK ea-stable
102+
if: ${{ inputs.setup-latest-java == 'true' }}
103+
uses: oracle-actions/setup-java@v1
104+
with:
105+
website: jdk.java.net
106+
release: ea
107+
version: stable
94108
- name: Cache local Maven repository (read-write)
95109
if: ${{ inputs.maven-cache == 'read-write' }}
96110
uses: actions/[email protected]
@@ -102,9 +116,9 @@ runs:
102116
!.m2/repository/io/helidon/**
103117
enableCrossOsArchive: true
104118
# only hash top-level poms to keep it fast
105-
key: local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }}
119+
key: ${{ inputs.cache-key-prefix }}local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }}
106120
restore-keys: |
107-
local-maven-
121+
${{ inputs.cache-key-prefix }}local-maven-
108122
- name: Cache local Maven repository (read-only)
109123
if: ${{ inputs.maven-cache == 'read-only' }}
110124
uses: actions/cache/[email protected]
@@ -113,9 +127,9 @@ runs:
113127
.m2/repository/**/*.*
114128
!.m2/repository/io/helidon/**
115129
enableCrossOsArchive: true
116-
key: local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }}
130+
key: ${{ inputs.cache-key-prefix }}local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }}
117131
restore-keys: |
118-
local-maven-
132+
${{ inputs.cache-key-prefix }}local-maven-
119133
- name: Build cache (read-write)
120134
if: ${{ inputs.build-cache == 'read-write' }}
121135
uses: actions/[email protected]
@@ -124,7 +138,7 @@ runs:
124138
./**/target/**
125139
.m2/repository/io/helidon/**
126140
enableCrossOsArchive: true
127-
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }}
141+
key: ${{ inputs.cache-key-prefix }}build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }}
128142
restore-keys: |
129143
build-cache-${{ github.run_id }}-${{ github.run_attempt }}-
130144
build-cache-${{ github.run_id }}-
@@ -137,10 +151,10 @@ runs:
137151
.m2/repository/io/helidon/**
138152
enableCrossOsArchive: true
139153
fail-on-cache-miss: true
140-
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }}
154+
key: ${{ inputs.cache-key-prefix }}build-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ inputs.build-cache-id }}
141155
restore-keys: |
142-
build-cache-${{ github.run_id }}-${{ github.run_attempt }}-
143-
build-cache-${{ github.run_id }}-
156+
${{ inputs.cache-key-prefix }}build-cache-${{ github.run_id }}-${{ github.run_attempt }}-
157+
${{ inputs.cache-key-prefix }}build-cache-${{ github.run_id }}-
144158
- name: Exec
145159
env:
146160
MVN_ARGS: |
@@ -159,7 +173,7 @@ runs:
159173
**/target/failsafe-reports/**
160174
**/target/it/**/*.log
161175
- name: Archive artifacts
162-
if: ${{ inputs.artifact-name != '' && inputs.artifact-path != '' && always() }}
176+
if: ${{ inputs.artifact-name != '' && inputs.artifact-path != '' && always() }}
163177
uses: actions/upload-artifact@v4
164178
with:
165179
if-no-files-found: 'ignore'

.github/workflows/nightly.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#
2+
# Copyright (c) 2025 Oracle and/or its affiliates.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: "Nightly Build"
17+
18+
on:
19+
schedule:
20+
- cron: '0 10 * * 0-6'
21+
22+
env:
23+
MVN_ARGS: |
24+
-B -fae -e
25+
-Dmaven.wagon.httpconnectionManager.ttlSeconds=60
26+
-Dmaven.wagon.http.retryHandler.count=3
27+
-Djdk.toolchain.version=${JAVA_VERSION}
28+
-Dcache.enabled=true
29+
30+
jobs:
31+
build:
32+
timeout-minutes: 15
33+
runs-on: ubuntu-22.04
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
ref: ${{ inputs.ref }}
38+
- uses: ./.github/actions/common
39+
with:
40+
build-cache: read-write
41+
maven-cache: read-write
42+
cache-key-prefix: latest-java-
43+
setup-latest-java: true
44+
run: |
45+
mvn ${MVN_ARGS} --version
46+
mvn ${MVN_ARGS} build-cache:go-offline
47+
mvn ${MVN_ARGS} -T8 \
48+
-Dorg.slf4j.simpleLogger.showThreadName=true \
49+
-DskipTests \
50+
-Ptests \
51+
install
52+
tests:
53+
needs: build
54+
timeout-minutes: 30
55+
strategy:
56+
matrix:
57+
os: [ ubuntu-22.04, windows-2022 ]
58+
moduleSet: [ core, it, jpa, jpa-oracle, dbclient, dbclient-oracle, others ]
59+
include:
60+
- { os: ubuntu-22.04, platform: linux }
61+
- { os: windows-2022, platform: windows }
62+
runs-on: ${{ matrix.os }}
63+
name: tests/${{ matrix.moduleSet }}-${{matrix.platform}}-latest-java
64+
steps:
65+
- uses: actions/checkout@v4
66+
with:
67+
ref: ${{ inputs.ref }}
68+
- uses: ./.github/actions/common
69+
with:
70+
build-cache: read-only
71+
cache-key-prefix: latest-java-
72+
setup-latest-java: true
73+
test-artifact-name: tests-${{ matrix.moduleSet }}-${{ matrix.platform }}-latest-java
74+
run: |
75+
mvn --version
76+
mvn ${MVN_ARGS} \
77+
-DreactorRule=tests \
78+
-DmoduleSet=${{ matrix.moduleSet }} \
79+
-Dsurefire.reportNameSuffix=${{ matrix.platform }} \
80+
verify

0 commit comments

Comments
 (0)