Skip to content

Commit f2e843d

Browse files
committed
Enable public micronaut tests
1 parent 0579681 commit f2e843d

3 files changed

Lines changed: 64 additions & 2 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#
2+
# Copyright (c) 2025, 2025, 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: Weekly Micronaut Tests (-H:+CompatibilityMode -H:Preserve=all)
42+
43+
on:
44+
pull_request:
45+
paths:
46+
- '.github/workflows/micronaut-template.yml'
47+
- '.github/workflows/micronaut-compatibility-preserve.yml'
48+
schedule:
49+
- cron: '0 2 * * 1'
50+
workflow_dispatch:
51+
52+
jobs:
53+
call-template:
54+
uses: './.github/workflows/micronaut-template.yml'
55+
with:
56+
NATIVE_IMAGE_OPTIONS: '-H:+UnlockExperimentalVMOptions -H:+ReportExceptionStackTraces -H:+CompatibilityMode -H:Preserve=all -H:-UnlockExperimentalVMOptions'

.github/workflows/micronaut-template.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ env:
5252
MICRONAUT_JAVA_VERSION: 21
5353
# Enforce experimental option checking in CI (GR-47922)
5454
NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL: 'true'
55-
NATIVE_IMAGE_OPTIONS: ${{ inputs.NATIVE_IMAGE_OPTIONS }}
5655

5756
permissions:
5857
contents: read # to fetch code (actions/checkout)
@@ -69,7 +68,9 @@ jobs:
6968
uses: ./.github/actions/build-graalvm
7069
with:
7170
java-version: ${{ env.MICRONAUT_JAVA_VERSION }}
72-
- name: Run nativeTest in Micronaut launch project
71+
- name: Run nativeTest in Micronaut launch project${{ inputs.NATIVE_IMAGE_OPTIONS && format(' with ''{0}''', inputs.NATIVE_IMAGE_OPTIONS) || '' }}
72+
env:
73+
NATIVE_IMAGE_OPTIONS: ${{ inputs.NATIVE_IMAGE_OPTIONS }}
7374
run: |
7475
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 }}'
7576
unzip demo.zip
@@ -81,6 +82,8 @@ jobs:
8182
repository: micronaut-projects/micronaut-core
8283
path: ${{ env.MICRONAUT_CORE_PATH }}
8384
- name: Run nativeTest in micronaut-core${{ inputs.NATIVE_IMAGE_OPTIONS && format(' with ''{0}''', inputs.NATIVE_IMAGE_OPTIONS) || '' }}
85+
env:
86+
NATIVE_IMAGE_OPTIONS: ${{ inputs.NATIVE_IMAGE_OPTIONS }}
8487
run: |
8588
cd ${{ env.MICRONAUT_CORE_PATH }}
8689
./gradlew nativeTest

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JDKInitializationFeature.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public void afterRegistration(AfterRegistrationAccess access) {
7474
rci.initializeAtBuildTime("com.sun.nio.sctp", JDK_CLASS_REASON);
7575
rci.initializeAtBuildTime("com.sun.nio.zipfs", JDK_CLASS_REASON);
7676

77+
rci.initializeAtBuildTime("com.sun.net.httpserver.HttpHandler", JDK_CLASS_REASON);
78+
rci.initializeAtRunTime("sun.net.httpserver.simpleserver", JDK_CLASS_REASON);
79+
7780
rci.initializeAtBuildTime("java.io", JDK_CLASS_REASON);
7881
rci.initializeAtBuildTime("java.lang", JDK_CLASS_REASON);
7982
rci.initializeAtBuildTime("java.math", JDK_CLASS_REASON);

0 commit comments

Comments
 (0)