Skip to content

Commit fb77c49

Browse files
committed
[GR-51885] Add nightly workflow for Micronaut.
PullRequest: graal/16941
2 parents 8f71459 + f99bc78 commit fb77c49

File tree

1 file changed

+127
-0
lines changed

1 file changed

+127
-0
lines changed

.github/workflows/micronaut.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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 Micronaut Tests
42+
43+
on:
44+
push:
45+
paths:
46+
- '.github/workflows/micronaut.yml'
47+
pull_request:
48+
paths:
49+
- '.github/workflows/micronaut.yml'
50+
schedule:
51+
- cron: '0 2 * * *'
52+
workflow_dispatch:
53+
54+
env:
55+
GRAALVM_HOME: ${{ github.workspace }}/graalvm
56+
JAVA_HOME: ${{ github.workspace }}/labsjdk
57+
LANG: en_US.UTF-8
58+
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
63+
# Enforce experimental option checking in CI (GR-47922)
64+
NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL: "true"
65+
66+
permissions:
67+
contents: read # to fetch code (actions/checkout)
68+
69+
jobs:
70+
build-graalvm-and-micronaut:
71+
name: Native Tests
72+
runs-on: ubuntu-20.04
73+
steps:
74+
- name: Checkout oracle/graal
75+
uses: actions/checkout@v4
76+
with:
77+
fetch-depth: 1
78+
- name: Determine mx version
79+
run: echo "MX_VERSION=$(jq -r '.mx_version' common.json)" >> ${GITHUB_ENV}
80+
- name: Checkout graalvm/mx
81+
uses: actions/checkout@v4
82+
with:
83+
repository: graalvm/mx
84+
fetch-depth: 1
85+
ref: ${{ env.MX_VERSION }}
86+
path: ${{ env.MX_PATH }}
87+
- name: Set up Python
88+
uses: actions/setup-python@v5
89+
with:
90+
python-version: '3.8'
91+
- name: Update mx cache
92+
uses: actions/cache@v3
93+
with:
94+
path: ~/.mx
95+
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
96+
restore-keys: ${{ runner.os }}-mx-
97+
- name: Fetch LabsJDK
98+
run: |
99+
mkdir jdk-dl
100+
${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-latest --to jdk-dl --alias ${JAVA_HOME}
101+
- name: Build GraalVM JDK
102+
run: |
103+
cd substratevm
104+
${MX_PATH}/mx --native=native-image --components="Native Image" build
105+
mv $(${MX_PATH}/mx --native=native-image --components="Native Image" graalvm-home) ${GRAALVM_HOME}
106+
${GRAALVM_HOME}/bin/native-image --version
107+
- name: Reconfigure JAVA_HOME for Micronaut
108+
uses: actions/setup-java@v4
109+
with:
110+
distribution: 'oracle'
111+
java-version: '${{ env.MICRONAUT_JDK_VERSION }}'
112+
- name: Run nativeTest in Micronaut launch project
113+
run: |
114+
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 }}'
115+
unzip demo.zip
116+
cd demo
117+
./gradlew nativeTest
118+
- name: Checkout micronaut-projects/micronaut-core
119+
uses: actions/checkout@v4
120+
with:
121+
repository: micronaut-projects/micronaut-core
122+
fetch-depth: 1
123+
path: ${{ env.MICRONAUT_CORE_PATH }}
124+
- name: Run nativeTest in micronaut-core
125+
run: |
126+
cd ${{ env.MICRONAUT_CORE_PATH }}
127+
./gradlew nativeTest

0 commit comments

Comments
 (0)