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
romain-grecourt authored and tvallin committed Nov 8, 2023
1 parent 0b49b56 commit 50d7204
Show file tree
Hide file tree
Showing 24 changed files with 370 additions and 26 deletions.
59 changes: 46 additions & 13 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 Down Expand Up @@ -75,7 +74,12 @@ jobs:
timeout-minutes: 60
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
Expand All @@ -85,13 +89,21 @@ jobs:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
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, macos-latest, windows-2022 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -124,10 +136,15 @@ jobs:
- name: Maven build
run: etc/scripts/mp-tck.sh
archetypes:
timeout-minutes: 45
timeout-minutes: 50
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
Expand All @@ -138,12 +155,28 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Test archetypes
run: etc/scripts/test-archetypes.sh
run: ${{ matrix.test-archetypes }}
packaging:
timeout-minutes: 60
strategy:
matrix:
os: [ ubuntu-20.04, macos-latest]
os: [ ubuntu-20.04, macos-latest, 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
test-native: etc/scripts/test-packaging-native.sh
- os: macos-latest
compile: etc/scripts/github-compile.sh
test-jar: etc/scripts/test-packaging-jar.sh
test-jlink: etc/scripts/test-packaging-jlink.sh
test-native: etc/scripts/test-packaging-native.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
test-native: etc/scripts/test-packaging-native.bat
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -155,10 +188,10 @@ jobs:
native-image-job-reports: true
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 }}
- name: Native-Image packaging
run: etc/scripts/test-packaging-native.sh
run: ${{ matrix.test-native }}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ void testIt() throws Exception {
.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
DefaultPrettyPrinter printer = new DefaultPrettyPrinter();
String json = mapper.writer(printer).writeValueAsString(customNamed);
assertThat(json, equalTo("{\n" + " \"stringSet\" : [ \"b\", \"a\", \"y\" ]\n" + "}"));
assertThat(normalizeNewLines(json), equalTo("{\n" + " \"stringSet\" : [ \"b\", \"a\", \"y\" ]\n" + "}"));
}

private String normalizeNewLines(String value) {
if (value == null) {
return null;
}
return value.replaceAll("\r\n", "\n");
}

}
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
2 changes: 1 addition & 1 deletion etc/scripts/includes/pipeline-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Arguments: $1 - Script path
# $2 - cd to Helidon root directory from script path
#
# Atleast WS_DIR or both arguments must be passed.
# At least WS_DIR or both arguments must be passed.

# WS_DIR variable verification.
if [ -z "${WS_DIR}" ]; then
Expand Down
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
48 changes: 48 additions & 0 deletions etc/scripts/test-packaging-jar.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@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
63 changes: 63 additions & 0 deletions etc/scripts/test-packaging-jlink.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@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

echo Skipping jlink tests, until we switch to Smallrye based Jandex in build tools - org.jboss fails with NPE on Java 21
exit 0

@REM Prime build all native-image tests
call mvn %MAVEN_ARGS% -e clean install

@REM Build jlink images
@REM mp-2 fails because of https://github.com/oracle/helidon-build-tools/issues/478
cd %WS_DIR%\tests\integration\native-image\mp-1
call mvn %MAVEN_ARGS% package -e -Pjlink-image,staging -Djlink.image.addClassDataSharingArchive=false -Djlink.image.testImage=false

cd %WS_DIR%\tests\integration\native-image\mp-3
call mvn %MAVEN_ARGS% package -e -Pjlink-image,staging -Djlink.image.addClassDataSharingArchive=false -Djlink.image.testImage=false

@REM Run tests with classpath and then module path

@REM Run MP-1
cd %WS_DIR%\tests\integration\native-image\mp-1
set jri_dir=%WS_DIR%\tests\integration\native-image\mp-1\target\helidon-tests-native-image-mp-1-jri

@REM Classpath
call %jri_dir%\bin\start --jvm

@REM Module Path
call %jri_dir%\bin\java ^
--module-path %jri_dir%\app\helidon-tests-native-image-mp-1.jar;%jri_dir%\app\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
set jri_dir=%WS_DIR%\tests\integration\native-image\mp-3\target\helidon-tests-native-image-mp-3-jri

@REM Classpath
call %jri_dir%\bin\start --test --jvm

@REM Module Path
call %jri_dir%\bin\java -Dexit.on.started=! ^
--module-path %jri_dir%\app\helidon-tests-native-image-mp-3.jar;%jri_dir%\app\libs ^
--add-modules helidon.tests.nimage.quickstartmp ^
--module io.helidon.microprofile.cdi/io.helidon.microprofile.cdi.Main
56 changes: 56 additions & 0 deletions etc/scripts/test-packaging-native.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
@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..\..

if "%GRAALVM_HOME%"=="" (
echo "ERROR: GRAALVM_HOME is not set";
exit 1
)

if not exist %GRAALVM_HOME%\bin\native-image.cmd (
echo "ERROR: %GRAALVM_HOME%\bin\native-image.cmd does not exist or is not executable";
exit 1
)

call mvn %MAVEN_ARGS% --version

echo "GRAALVM_HOME=%GRAALVM_HOME%"
call %GRAALVM_HOME%\bin\native-image.cmd --version

@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 Build native images
for %%v in (se-1 mp-1 mp-3) do (
echo %%v
cd %WS_DIR%\tests\integration\native-image\%%v
call mvn %MAVEN_ARGS% -e clean package -Pnative-image
)

@REM Run this one because it has no pre-reqs and self-tests
@REM Uses relative path to read configuration
cd %WS_DIR%\tests\integration\native-image\mp-1
call %WS_DIR%\tests\integration\native-image\mp-1\target\helidon-tests-native-image-mp-1 || true

@REM Run se-1 exiting on started
cd %WS_DIR%\tests\integration\native-image\se-1
call %WS_DIR%\tests\integration\native-image\se-1\target\helidon-tests-native-image-se-1 -Dexit.on.started=! || true
Loading

0 comments on commit 50d7204

Please sign in to comment.