Skip to content

Commit

Permalink
Create job for native-image testing of quickstarts.
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <[email protected]>
  • Loading branch information
tvallin authored and romain-grecourt committed May 24, 2024
1 parent c06dc1f commit 39c131c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Maven build
run: etc/scripts/github-build.sh
examples:
timeout-minutes: 30
timeout-minutes: 40
strategy:
matrix:
os: [ ubuntu-20.04, macos-14 ]
Expand All @@ -101,11 +101,20 @@ jobs:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- uses: graalvm/setup-graalvm@v1
with:
java-version: 21
distribution: graalvm-community
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: true
cache: maven
- name: Maven build
run: |
mvn -B -e "-Dmaven.test.skip=true" $MAVEN_HTTP_ARGS -DskipTests -Ppipeline install
cd examples
mvn -B verify
- name: Test quickstarts native image
run: etc/scripts/test-quickstarts.sh
mp-tck:
timeout-minutes: 60
name: "MicroProfile TCKs"
Expand Down
47 changes: 47 additions & 0 deletions etc/scripts/test-quickstarts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash -e
#
# Copyright (c) 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Path to this script
[ -h "${0}" ] && readonly SCRIPT_PATH="$(readlink "${0}")" || readonly SCRIPT_PATH="${0}"

# Load pipeline environment setup and define WS_DIR
. $(dirname -- "${SCRIPT_PATH}")/includes/pipeline-env.sh "${SCRIPT_PATH}" '../..'

# Setup error handling using default settings (defined in includes/error_handlers.sh)
error_trap_setup

if [ -z "${GRAALVM_HOME}" ]; then
echo "ERROR: GRAALVM_HOME is not set";
exit 1
fi

if [ ! -x "${GRAALVM_HOME}/bin/native-image" ]; then
echo "ERROR: ${GRAALVM_HOME}/bin/native-image does not exist or is not executable";
exit 1
fi

mvn ${MAVEN_ARGS} --version

${GRAALVM_HOME}/bin/native-image --version;

# Build quickstart native-image executable and run jar file
readonly quickstarts="helidon-quickstart-mp helidon-quickstart-se"
for quickstart in ${quickstarts}; do
cd "${WS_DIR}"/examples/quickstarts/"${quickstart}"
mvn ${MAVEN_ARGS} -e clean install -Pnative-image -DskipTests
./target/"${quickstart}" -Dexit.on.started=!
done

0 comments on commit 39c131c

Please sign in to comment.