Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions #4830

Merged
merged 7 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Notes
# - cannot run on windows, as we use shell scripts
# - removed macos-latest from most jobs to speed up the process

name: "Validate PR"

on:
pull_request:
branches: [ "main" ]

workflow_dispatch:

env:
JAVA_VERSION: '19'
JAVA_DISTRO: 'temurin'
HELIDON_PIPELINES: 'true'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
copyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Copyright
run: etc/scripts/copyright.sh
checkstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Checkstyle
run: etc/scripts/checkstyle.sh
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Docs
run: etc/scripts/site.sh
spotbugs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Spotbugs
run: etc/scripts/spotbugs.sh
build:
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Maven build
run: etc/scripts/github-build.sh
archetypes:
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Test archetypes
run: etc/scripts/test-archetypes.sh
packaging:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: JAR packaging
run: etc/scripts/test-packaging-jar.sh
- name: JLink packaging
run: etc/scripts/test-packaging-jlink.sh
- name: MP-1 test
run: tests/integration/native-image/mp-1/test-runtime.sh
- name: MP-3 test
run: tests/integration/native-image/mp-3/test-runtime.sh

63 changes: 1 addition & 62 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,6 @@ pipeline {
stages {
stage('default') {
parallel {
stage('build'){
steps {
script {
try {
sh './etc/scripts/build.sh'
} finally {
archiveArtifacts artifacts: "**/target/surefire-reports/*.txt, **/target/failsafe-reports/*.txt"
junit testResults: '**/target/surefire-reports/*.xml,**/target/failsafe-reports/*.xml'
}
}
}
}
stage('copyright'){
steps {
sh './etc/scripts/copyright.sh'
}
}
stage('checkstyle'){
steps {
sh './etc/scripts/checkstyle.sh'
}
}
stage('archetypes'){
agent {
label "linux"
}
steps {
script {
try {
sh 'etc/scripts/test-archetypes.sh'
} finally {
archiveArtifacts artifacts: "archetypes/**/target/**/*.txt"
junit testResults: '**/target/surefire-reports/*.xml'
}
}
}
}
stage('integration-tests') {
stages {
stage('test-vault') {
Expand All @@ -79,30 +42,6 @@ pipeline {
junit testResults: '**/target/surefire-reports/*.xml'
}
}
stage('test-packaging-jar'){
agent {
label "linux"
}
steps {
sh 'etc/scripts/test-packaging-jar.sh'
}
}
stage('test-packaging-jlink'){
agent {
label "linux"
}
steps {
sh 'etc/scripts/test-packaging-jlink.sh'
}
}
stage('test-packaging-native'){
agent {
label "linux"
}
steps {
sh 'etc/scripts/test-packaging-native.sh'
}
}
}
}
}
Expand All @@ -123,4 +62,4 @@ pipeline {
}
}
}
}
}
41 changes: 41 additions & 0 deletions etc/scripts/github-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash -e
#
# Copyright (c) 2018, 2022 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

mvn ${MAVEN_ARGS} --version

mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml \
install -e \
-Dmaven.test.failure.ignore=true \
-Pexamples,archetypes,javadoc,sources,tck,tests,pipeline

#
# test running from jar file, and then from module path
#
# The first integration test tests all MP features except for JPA/JTA
# with multiple JAX-RS applications including security
tests/integration/native-image/mp-1/test-runtime.sh
# The third integration test tests Helidon Quickstart MP
tests/integration/native-image/mp-3/test-runtime.sh
8 changes: 8 additions & 0 deletions etc/scripts/includes/pipeline-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ if [ -z "${__PIPELINE_ENV_INCLUDED__}" ]; then
PATH="${PATH}:${JAVA_HOME}/bin"
}

if [ -n "${HELIDON_PIPELINES}" ] ; then
export PIPELINE="true"
MAVEN_ARGS="${MAVEN_ARGS} -B"
export MAVEN_ARGS
# temporary fix for copyright plugin (currently fails on big renaming action for Nima)
git config diff.renameLimit 32768
fi

if [ -n "${JENKINS_HOME}" ] ; then
export PIPELINE="true"
export JAVA_HOME="/tools/jdk19"
Expand Down
29 changes: 29 additions & 0 deletions etc/scripts/site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash -e
#
# Copyright (c) 2022 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

mvn ${MAVEN_ARGS} --version

mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml -N site -Ppipeline
32 changes: 32 additions & 0 deletions etc/scripts/spotbugs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash -e
#
# Copyright (c) 2022 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

mvn ${MAVEN_ARGS} --version

mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml \
install -e \
-DskipTests \
-Pspotbugs,pipeline