-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: tvallin <[email protected]>
- Loading branch information
Showing
26 changed files
with
369 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# Notes | ||
# - cannot run on Windows, as we use shell scripts | ||
# - removed macos-latest from most jobs to speed up the process | ||
|
||
name: "Validate" | ||
|
@@ -24,83 +23,90 @@ jobs: | |
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK ${{ env.JAVA_VERSION }} | ||
- name: Set up JDK ${{ env.JAVA_RELEASE }} | ||
uses: oracle-actions/[email protected] | ||
with: | ||
website: ${{ env.JAVA_DISTRO }} | ||
release: ${{ env.JAVA_RELEASE }} | ||
cache: maven | ||
- name: Copyright | ||
run: etc/scripts/copyright.sh | ||
checkstyle: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ env.JAVA_VERSION }} | ||
- name: Set up JDK ${{ env.JAVA_RELEASE }} | ||
uses: oracle-actions/[email protected] | ||
with: | ||
website: ${{ env.JAVA_DISTRO }} | ||
release: ${{ env.JAVA_RELEASE }} | ||
cache: maven | ||
- name: Checkstyle | ||
run: etc/scripts/checkstyle.sh | ||
spotbugs: | ||
timeout-minutes: 45 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ env.JAVA_VERSION }} | ||
- name: Set up JDK ${{ env.JAVA_RELEASE }} | ||
uses: oracle-actions/[email protected] | ||
with: | ||
website: ${{ env.JAVA_DISTRO }} | ||
release: ${{ env.JAVA_RELEASE }} | ||
cache: maven | ||
- name: Spotbugs | ||
run: etc/scripts/spotbugs.sh | ||
docs: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ env.JAVA_VERSION }} | ||
- name: Set up JDK ${{ env.JAVA_RELEASE }} | ||
uses: oracle-actions/[email protected] | ||
with: | ||
website: ${{ env.JAVA_DISTRO }} | ||
release: ${{ env.JAVA_RELEASE }} | ||
cache: maven | ||
- name: Docs | ||
run: etc/scripts/site.sh | ||
build: | ||
timeout-minutes: 60 | ||
timeout-minutes: 100 | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-20.04 ] | ||
os: [ ubuntu-20.04, windows-2022 ] | ||
include: | ||
- os: ubuntu-20.04 | ||
build_script: etc/scripts/github-build.sh | ||
- os: windows-2022 | ||
build_script: etc/scripts/github-build.bat | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ env.JAVA_VERSION }} | ||
- name: Set up JDK ${{ env.JAVA_RELEASE }} | ||
uses: oracle-actions/[email protected] | ||
with: | ||
website: ${{ env.JAVA_DISTRO }} | ||
release: ${{ env.JAVA_RELEASE }} | ||
cache: maven | ||
- name: Maven build | ||
run: etc/scripts/github-build.sh | ||
- name: Maven Build | ||
run: ${{ matrix.build_script }} | ||
- name: Archive test results | ||
uses: actions/[email protected] | ||
if: always() | ||
with: | ||
name: test-results | ||
path: | | ||
**/target/surefire-reports/*.txt | ||
**/target/it/**/*.log | ||
examples: | ||
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-20.04, macos-latest ] | ||
os: [ ubuntu-20.04, windows-2022 ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ env.JAVA_VERSION }} | ||
- name: Set up JDK ${{ env.JAVA_RELEASE }} | ||
uses: oracle-actions/[email protected] | ||
with: | ||
website: ${{ env.JAVA_DISTRO }} | ||
release: ${{ env.JAVA_RELEASE }} | ||
cache: maven | ||
- name: Maven build | ||
run: | | ||
mvn -B -e "-Dmaven.test.skip=true" $MAVEN_HTTP_ARGS -DskipTests -Ppipeline install | ||
|
@@ -115,47 +121,58 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ env.JAVA_VERSION }} | ||
- name: Set up JDK ${{ env.JAVA_RELEASE }} | ||
uses: oracle-actions/[email protected] | ||
with: | ||
website: ${{ env.JAVA_DISTRO }} | ||
release: ${{ env.JAVA_RELEASE }} | ||
cache: maven | ||
- name: Maven build | ||
run: etc/scripts/mp-tck.sh | ||
archetypes: | ||
timeout-minutes: 45 | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-20.04 ] | ||
os: [ ubuntu-20.04, windows-2022 ] | ||
include: | ||
- os: ubuntu-20.04 | ||
test-archetypes: etc/scripts/test-archetypes.sh | ||
- os: windows-2022 | ||
test-archetypes: etc/scripts/test-archetypes.bat | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ env.JAVA_VERSION }} | ||
- name: Set up JDK ${{ env.JAVA_RELEASE }} | ||
uses: oracle-actions/[email protected] | ||
with: | ||
website: ${{ env.JAVA_DISTRO }} | ||
release: ${{ env.JAVA_RELEASE }} | ||
cache: maven | ||
- name: Test archetypes | ||
run: etc/scripts/test-archetypes.sh | ||
- name: Test Archetypes | ||
run: ${{ matrix.test-archetypes }} | ||
packaging: | ||
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-20.04, macos-latest] | ||
os: [ ubuntu-20.04, windows-2022 ] | ||
include: | ||
- os: ubuntu-20.04 | ||
compile: etc/scripts/github-compile.sh | ||
test-jar: etc/scripts/test-packaging-jar.sh | ||
test-jlink: etc/scripts/test-packaging-jlink.sh | ||
- os: windows-2022 | ||
compile: etc/scripts/github-compile.bat | ||
test-jar: etc/scripts/test-packaging-jar.bat | ||
test-jlink: etc/scripts/test-packaging-jlink.bat | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ env.JAVA_VERSION }} | ||
- name: Set up JDK ${{ env.JAVA_RELEASE }} | ||
uses: oracle-actions/[email protected] | ||
with: | ||
website: ${{ env.JAVA_DISTRO }} | ||
release: ${{ env.JAVA_RELEASE }} | ||
cache: maven | ||
- name: Build Helidon | ||
run: etc/scripts/github-compile.sh | ||
run: ${{ matrix.compile }} | ||
- name: JAR packaging | ||
run: etc/scripts/test-packaging-jar.sh | ||
run: ${{ matrix.test-jar }} | ||
- name: JLink packaging | ||
run: etc/scripts/test-packaging-jlink.sh | ||
run: ${{ matrix.test-jlink }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
common/common/src/main/java/io/helidon/common/Strings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (c) 2023 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. | ||
*/ | ||
package io.helidon.common; | ||
|
||
/** | ||
* String utility methods. | ||
*/ | ||
public class Strings { | ||
|
||
/** | ||
* Normalize newlines. | ||
* | ||
* @param value The value to normalize, may be {@code null} | ||
* @return normalized value | ||
*/ | ||
public static String normalizeNewLines(String value) { | ||
if (value == null) { | ||
return null; | ||
} | ||
return value.replaceAll("\r\n", "\n"); | ||
} | ||
|
||
/** | ||
* Force UNIX style path on Windows. | ||
* | ||
* @param value The value to normalize, may be {@code null} | ||
* @return normalized value | ||
*/ | ||
public static String normalizePath(String value) { | ||
if (value == null) { | ||
return null; | ||
} | ||
return value.replace("\\", "/"); | ||
} | ||
|
||
private Strings() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@REM | ||
@REM Copyright (c) 2023 Oracle and/or its affiliates. | ||
@REM | ||
@REM Licensed under the Apache License, Version 2.0 (the "License"); | ||
@REM you may not use this file except in compliance with the License. | ||
@REM You may obtain a copy of the License at | ||
@REM | ||
@REM http://www.apache.org/licenses/LICENSE-2.0 | ||
@REM | ||
@REM Unless required by applicable law or agreed to in writing, software | ||
@REM distributed under the License is distributed on an "AS IS" BASIS, | ||
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
@REM See the License for the specific language governing permissions and | ||
@REM limitations under the License. | ||
@REM | ||
|
||
@echo off | ||
|
||
cd %~dp0\..\.. | ||
|
||
mvn %MAVEN_ARGS% -f %cd%\pom.xml ^ | ||
install -e ^ | ||
-Dmaven.test.failure.ignore=false ^ | ||
-Pjavadoc,sources,tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@REM | ||
@REM Copyright (c) 2023 Oracle and/or its affiliates. | ||
@REM | ||
@REM Licensed under the Apache License, Version 2.0 (the "License"); | ||
@REM you may not use this file except in compliance with the License. | ||
@REM You may obtain a copy of the License at | ||
@REM | ||
@REM http://www.apache.org/licenses/LICENSE-2.0 | ||
@REM | ||
@REM Unless required by applicable law or agreed to in writing, software | ||
@REM distributed under the License is distributed on an "AS IS" BASIS, | ||
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
@REM See the License for the specific language governing permissions and | ||
@REM limitations under the License. | ||
@REM | ||
|
||
@echo off | ||
cd %~dp0\..\.. | ||
|
||
mvn %MAVEN_ARGS% -f %cd%\pom.xml ^ | ||
install -e ^ | ||
-DskipTests ^ | ||
-Ppipeline,tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@REM | ||
@REM Copyright (c) 2023 Oracle and/or its affiliates. | ||
@REM | ||
@REM Licensed under the Apache License, Version 2.0 (the "License"); | ||
@REM you may not use this file except in compliance with the License. | ||
@REM You may obtain a copy of the License at | ||
@REM | ||
@REM http://www.apache.org/licenses/LICENSE-2.0 | ||
@REM | ||
@REM Unless required by applicable law or agreed to in writing, software | ||
@REM distributed under the License is distributed on an "AS IS" BASIS, | ||
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
@REM See the License for the specific language governing permissions and | ||
@REM limitations under the License. | ||
@REM | ||
|
||
@echo off | ||
cd %~dp0\..\.. | ||
|
||
CALL etc\scripts\github-compile.bat | ||
|
||
cd %cd%\archetypes | ||
|
||
mvn %MAVEN_ARGS% -e clean install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@REM | ||
@REM Copyright (c) 2023 Oracle and/or its affiliates. | ||
@REM | ||
@REM Licensed under the Apache License, Version 2.0 (the "License"); | ||
@REM you may not use this file except in compliance with the License. | ||
@REM You may obtain a copy of the License at | ||
@REM | ||
@REM http://www.apache.org/licenses/LICENSE-2.0 | ||
@REM | ||
@REM Unless required by applicable law or agreed to in writing, software | ||
@REM distributed under the License is distributed on an "AS IS" BASIS, | ||
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
@REM See the License for the specific language governing permissions and | ||
@REM limitations under the License. | ||
@REM | ||
|
||
@echo off | ||
|
||
set WS_DIR=%~dp0\..\.. | ||
|
||
@REM Run native image tests | ||
cd %WS_DIR%\tests\integration\native-image | ||
|
||
@REM Prime build all native-image tests | ||
call mvn %MAVEN_ARGS% -e clean install | ||
|
||
@REM Run tests with classpath and then module path | ||
|
||
@REM Run MP-1 | ||
cd %WS_DIR%\tests\integration\native-image\mp-1 | ||
|
||
@REM Classpath | ||
call java -jar target\helidon-tests-native-image-mp-1.jar | ||
|
||
@REM Module Path | ||
call java --module-path target\helidon-tests-native-image-mp-1.jar;target\libs ^ | ||
--module helidon.tests.nimage.mp/io.helidon.tests.integration.nativeimage.mp1.Mp1Main | ||
|
||
@REM Run MP-3 (just start and stop) | ||
cd %WS_DIR%\tests\integration\native-image\mp-3 | ||
@REM Classpath | ||
call java -Dexit.on.started=! -jar target\helidon-tests-native-image-mp-3.jar | ||
|
||
@REM Module Path | ||
call java -Dexit.on.started=! ^ | ||
--module-path target\helidon-tests-native-image-mp-3.jar;target\libs ^ | ||
--add-modules helidon.tests.nimage.quickstartmp ^ | ||
--module io.helidon.microprofile.cdi/io.helidon.microprofile.cdi.Main | ||
|
Oops, something went wrong.