Skip to content

Commit

Permalink
Windows GA
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <[email protected]>
  • Loading branch information
tvallin committed Jul 20, 2023
1 parent fb7585c commit c4c4558
Show file tree
Hide file tree
Showing 26 changed files with 369 additions and 42 deletions.
79 changes: 48 additions & 31 deletions .github/workflows/validate.yml
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"
Expand All @@ -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
Expand All @@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
package io.helidon.builder.test;

import io.helidon.builder.test.testsubjects.CustomNamed;
import io.helidon.common.Strings;

import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.junit.jupiter.api.Test;

import static io.helidon.common.Strings.normalizeNewLines;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

Expand Down Expand Up @@ -54,6 +57,7 @@ void testIt() throws Exception {
.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
DefaultPrettyPrinter printer = new DefaultPrettyPrinter();
String json = mapper.writer(printer).writeValueAsString(customNamed);
json = normalizeNewLines(json);
assertThat(json, equalTo("{\n" + " \"stringSet\" : [ \"b\", \"a\", \"y\" ]\n" + "}"));
}

Expand Down
51 changes: 51 additions & 0 deletions common/common/src/main/java/io/helidon/common/Strings.java
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() {
}
}
24 changes: 24 additions & 0 deletions etc/scripts/github-build.bat
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
23 changes: 23 additions & 0 deletions etc/scripts/github-compile.bat
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
24 changes: 24 additions & 0 deletions etc/scripts/test-archetypes.bat
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
49 changes: 49 additions & 0 deletions etc/scripts/test-packaging-jar.bat
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

Loading

0 comments on commit c4c4558

Please sign in to comment.