Skip to content

Commit 82e9cd6

Browse files
committed
[GR-52456] Add nightly workflow for Spring.
PullRequest: graal/17168
2 parents d0041dd + 0c8384d commit 82e9cd6

File tree

4 files changed

+156
-81
lines changed

4 files changed

+156
-81
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build GraalVM JDK
2+
description: 'Build GraalVM JDK and set up environment for testing'
3+
4+
inputs:
5+
java-version:
6+
description: 'Java version to use'
7+
required: false
8+
default: ''
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Set up environment variables
14+
shell: bash
15+
run: |
16+
echo "GRAALVM_HOME=${{ github.workspace }}/graalvm" >> ${GITHUB_ENV}
17+
echo "LABSJDK_HOME=${{ github.workspace }}/labsjdk" >> ${GITHUB_ENV}
18+
echo "MX_GIT_CACHE=refcache" >> ${GITHUB_ENV}
19+
echo "MX_PATH=${{ github.workspace }}/mx" >> ${GITHUB_ENV}
20+
echo "MX_PYTHON=python3.8" >> ${GITHUB_ENV}
21+
echo "MX_VERSION=$(jq -r '.mx_version' common.json)" >> ${GITHUB_ENV}
22+
# Workaround testsuite locale issue
23+
echo "LANG=en_US.UTF-8" >> ${GITHUB_ENV}
24+
- name: Checkout graalvm/mx
25+
uses: actions/checkout@v4
26+
with:
27+
repository: graalvm/mx
28+
fetch-depth: 1
29+
ref: ${{ env.MX_VERSION }}
30+
path: ${{ env.MX_PATH }}
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.8'
35+
- name: Update mx cache
36+
uses: actions/cache@v4
37+
with:
38+
path: ~/.mx
39+
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
40+
restore-keys: ${{ runner.os }}-mx-
41+
- name: Fetch LabsJDK
42+
shell: bash
43+
run: |
44+
mkdir jdk-dl
45+
${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-latest --to jdk-dl --alias ${LABSJDK_HOME}
46+
- name: Build GraalVM JDK
47+
shell: bash
48+
run: |
49+
cd substratevm
50+
${MX_PATH}/mx --java-home=${LABSJDK_HOME} --native=native-image --components="Native Image" build
51+
ln -s $(${MX_PATH}/mx --java-home=${LABSJDK_HOME} --native=native-image --components="Native Image" graalvm-home) ${GRAALVM_HOME}
52+
${GRAALVM_HOME}/bin/native-image --version
53+
- name: Set up JAVA_HOME
54+
if: ${{ inputs.java-version }} != ''
55+
uses: actions/setup-java@v4
56+
with:
57+
distribution: 'oracle'
58+
java-version: '${{ inputs.java-version }}'
59+

.github/workflows/micronaut.yml

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,10 @@ on:
5252
workflow_dispatch:
5353

5454
env:
55-
GRAALVM_HOME: ${{ github.workspace }}/graalvm
56-
JAVA_HOME: ${{ github.workspace }}/labsjdk
57-
LANG: en_US.UTF-8
5855
MICRONAUT_CORE_PATH: ${{ github.workspace }}/micronaut-core
59-
MICRONAUT_JDK_VERSION: 21
60-
MX_GIT_CACHE: refcache
61-
MX_PATH: ${{ github.workspace }}/mx
62-
MX_PYTHON: python3.8
56+
MICRONAUT_JAVA_VERSION: 21
6357
# Enforce experimental option checking in CI (GR-47922)
64-
NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL: "true"
58+
NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL: 'true'
6559

6660
permissions:
6761
contents: read # to fetch code (actions/checkout)
@@ -76,43 +70,13 @@ jobs:
7670
uses: actions/checkout@v4
7771
with:
7872
fetch-depth: 1
79-
- name: Determine mx version
80-
run: echo "MX_VERSION=$(jq -r '.mx_version' common.json)" >> ${GITHUB_ENV}
81-
- name: Checkout graalvm/mx
82-
uses: actions/checkout@v4
83-
with:
84-
repository: graalvm/mx
85-
fetch-depth: 1
86-
ref: ${{ env.MX_VERSION }}
87-
path: ${{ env.MX_PATH }}
88-
- name: Set up Python
89-
uses: actions/setup-python@v5
90-
with:
91-
python-version: '3.8'
92-
- name: Update mx cache
93-
uses: actions/cache@v4
94-
with:
95-
path: ~/.mx
96-
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
97-
restore-keys: ${{ runner.os }}-mx-
98-
- name: Fetch LabsJDK
99-
run: |
100-
mkdir jdk-dl
101-
${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-latest --to jdk-dl --alias ${JAVA_HOME}
10273
- name: Build GraalVM JDK
103-
run: |
104-
cd substratevm
105-
${MX_PATH}/mx --native=native-image --components="Native Image" build
106-
mv $(${MX_PATH}/mx --native=native-image --components="Native Image" graalvm-home) ${GRAALVM_HOME}
107-
${GRAALVM_HOME}/bin/native-image --version
108-
- name: Reconfigure JAVA_HOME for Micronaut
109-
uses: actions/setup-java@v4
74+
uses: ./.github/actions/build-graalvm
11075
with:
111-
distribution: 'oracle'
112-
java-version: '${{ env.MICRONAUT_JDK_VERSION }}'
76+
java-version: ${{ env.MICRONAUT_JAVA_VERSION }}
11377
- name: Run nativeTest in Micronaut launch project
11478
run: |
115-
curl --fail --silent --location --retry 3 --max-time 10 --output demo.zip --request GET 'https://launch.micronaut.io/create/default/com.example.demo?lang=JAVA&build=GRADLE&test=JUNIT&javaVersion=JDK_${{ env.MICRONAUT_JDK_VERSION }}'
79+
curl --fail --silent --location --retry 3 --max-time 10 --output demo.zip --request GET 'https://launch.micronaut.io/create/default/com.example.demo?lang=JAVA&build=GRADLE&test=JUNIT&javaVersion=JDK_${{ env.MICRONAUT_JAVA_VERSION }}'
11680
unzip demo.zip
11781
cd demo
11882
./gradlew nativeTest

.github/workflows/quarkus.yml

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,15 @@ on:
4949
- '.github/workflows/quarkus.yml'
5050
schedule:
5151
- cron: '0 3 * * *'
52+
workflow_dispatch:
5253

5354
env:
5455
COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end"
5556
DB_NAME: hibernate_orm_test
5657
DB_PASSWORD: hibernate_orm_test
5758
DB_USER: hibernate_orm_test
58-
GRAALVM_HOME: ${{ github.workspace }}/graalvm
59-
LABSJDK_HOME: ${{ github.workspace }}/jdk
60-
LANG: en_US.UTF-8 # Workaround testsuite locale issue
61-
MX_GIT_CACHE: refcache
62-
MX_PATH: ${{ github.workspace }}/mx
63-
MX_PYTHON: python3.8
6459
NATIVE_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dquarkus.native.native-image-xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs -Dquarkus.native.container-build=false"
60+
QUARKUS_JAVA_VERSION: 17 # Use Java 17 to build Quarkus as that's the lowest supported JDK version currently
6561
QUARKUS_PATH: ${{ github.workspace }}/quarkus
6662

6763
permissions: {}
@@ -80,17 +76,10 @@ jobs:
8076
uses: actions/checkout@v4
8177
with:
8278
fetch-depth: 1
83-
- name: Checkout graalvm/mx
84-
uses: actions/checkout@v4
85-
with:
86-
repository: graalvm/mx.git
87-
fetch-depth: 1
88-
ref: master
89-
path: ${{ env.MX_PATH }}
90-
- name: Set up Python
91-
uses: actions/setup-python@v5
79+
- name: Build GraalVM JDK
80+
uses: ./.github/actions/build-graalvm
9281
with:
93-
python-version: '3.8'
82+
java-version: ${{ env.QUARKUS_JAVA_VERSION }}
9483
- name: Get latest Quarkus release
9584
run: |
9685
export QUARKUS_VERSION=main #$(curl https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/latest/ {print $3}')
@@ -104,36 +93,14 @@ jobs:
10493
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
10594
restore-keys: |
10695
${{ runner.os }}-maven-
107-
- uses: actions/cache@v4
108-
with:
109-
path: ~/.mx
110-
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
111-
restore-keys: |
112-
${{ runner.os }}-mx-
113-
- name: Fetch LabsJDK
114-
run: |
115-
mkdir jdk-dl
116-
${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-latest --to jdk-dl --alias ${LABSJDK_HOME}
117-
- name: Build graalvm native-image
118-
run: |
119-
export JAVA_HOME=${LABSJDK_HOME}
120-
cd substratevm
121-
${MX_PATH}/mx --native=native-image,lib:jvmcicompiler --components="Native Image,LibGraal" build
122-
mv $(${MX_PATH}/mx --native=native-image,lib:jvmcicompiler --components="Native Image,LibGraal" graalvm-home) ${GRAALVM_HOME}
123-
${GRAALVM_HOME}/bin/native-image --version
12496
- name: Tar GraalVM
12597
shell: bash
126-
run: tar -czvf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) $(basename ${GRAALVM_HOME})
98+
run: tar -czvhf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) $(basename ${GRAALVM_HOME})
12799
- name: Persist GraalVM build
128100
uses: actions/upload-artifact@v4
129101
with:
130102
name: graalvm
131103
path: graalvm.tgz
132-
# Use Java 17 to build Quarkus as that's the lowest supported JDK version currently
133-
- uses: actions/setup-java@v4
134-
with:
135-
distribution: 'oracle'
136-
java-version: '17'
137104
- name: Build Quarkus
138105
run: |
139106
cd ${QUARKUS_PATH}
@@ -157,6 +124,8 @@ jobs:
157124
name: Native Tests - ${{matrix.category}}
158125
needs: build-quarkus-and-graalvm
159126
runs-on: ubuntu-latest
127+
env:
128+
GRAALVM_HOME: ${{ github.workspace }}/graalvm # identical to the one in ./.github/actions/build-graalvm
160129
# Ignore the following YAML Schema error
161130
timeout-minutes: ${{matrix.timeout}}
162131
strategy:
@@ -204,7 +173,6 @@ jobs:
204173
env:
205174
TEST_MODULES: ${{matrix.test-modules}}
206175
run: |
207-
export GRAALVM_HOME=${{ github.workspace }}/graalvm
208176
cd ${QUARKUS_PATH}
209177
${GRAALVM_HOME}/bin/native-image --version
210178
./mvnw $COMMON_MAVEN_ARGS -f integration-tests -pl "$TEST_MODULES" $NATIVE_TEST_MAVEN_ARGS

.github/workflows/spring.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#
2+
# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# The Universal Permissive License (UPL), Version 1.0
6+
#
7+
# Subject to the condition set forth below, permission is hereby granted to any
8+
# person obtaining a copy of this software, associated documentation and/or
9+
# data (collectively the "Software"), free of charge and under any and all
10+
# copyright rights in the Software, and any and all patent rights owned or
11+
# freely licensable by each licensor hereunder covering either (i) the
12+
# unmodified Software as contributed to or provided by such licensor, or (ii)
13+
# the Larger Works (as defined below), to deal in both
14+
#
15+
# (a) the Software, and
16+
#
17+
# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
18+
# one is included with the Software each a "Larger Work" to which the Software
19+
# is contributed by such licensors),
20+
#
21+
# without restriction, including without limitation the rights to copy, create
22+
# derivative works of, display, perform, and distribute the Software and make,
23+
# use, sell, offer for sale, import, export, have made, and have sold the
24+
# Software and the Larger Work(s), and to sublicense the foregoing rights on
25+
# either these or other terms.
26+
#
27+
# This license is subject to the following condition:
28+
#
29+
# The above copyright notice and either this complete permission notice or at a
30+
# minimum a reference to the UPL must be included in all copies or substantial
31+
# portions of the Software.
32+
#
33+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
# SOFTWARE.
40+
#
41+
name: Nightly Spring Tests
42+
43+
on:
44+
push:
45+
paths:
46+
- '.github/workflows/spring.yml'
47+
pull_request:
48+
paths:
49+
- '.github/workflows/spring.yml'
50+
schedule:
51+
- cron: '0 4 * * *'
52+
workflow_dispatch:
53+
54+
env:
55+
SPRING_PETCLINIC_PATH: ${{ github.workspace }}/spring-petclinic
56+
SPRING_JAVA_VERSION: 21
57+
58+
permissions:
59+
contents: read # to fetch code (actions/checkout)
60+
61+
jobs:
62+
build-graalvm-and-spring:
63+
name: Native Tests
64+
runs-on: ubuntu-20.04
65+
if: (github.event_name == 'schedule' && github.repository == 'oracle/graal') || (github.event_name != 'schedule')
66+
steps:
67+
- name: Checkout oracle/graal
68+
uses: actions/checkout@v4
69+
with:
70+
fetch-depth: 1
71+
- name: Build GraalVM JDK
72+
uses: ./.github/actions/build-graalvm
73+
with:
74+
java-version: ${{ env.SPRING_JAVA_VERSION }}
75+
- name: Checkout spring-projects/spring-petclinic
76+
uses: actions/checkout@v4
77+
with:
78+
repository: spring-projects/spring-petclinic
79+
fetch-depth: 1
80+
path: ${{ env.SPRING_PETCLINIC_PATH }}
81+
- name: Run nativeTest in spring-petclinic
82+
run: |
83+
cd ${{ env.SPRING_PETCLINIC_PATH }}
84+
./gradlew nativeTest

0 commit comments

Comments
 (0)