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

JDK 16 support, fixes #427 #428

Merged
merged 4 commits into from Jun 15, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
168 changes: 168 additions & 0 deletions .github/workflows/test-jdk16.yaml
@@ -0,0 +1,168 @@
#
# Copyright (c) 2017 Angelo Zerr and other contributors as
# indicated by the @author tags.
#
# 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.
#

name: GitHub Actions
on: [push, pull_request]

env:
GRAALVM_VERSION: '21.1.0.java16'

jobs:

linux-jdk16:
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v1

- name: Set VERSION env var
run: echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: setup-graalvm-ce
uses: DeLaGuardo/setup-graalvm@8bbfe44ef9c6f5c07e5af036a1bffd561c037d18
with:
graalvm-version: ${{ env.GRAALVM_VERSION }}

- name: gu install native-image
run: gu install native-image

- name: Skip tests when releasing from a tag
if: startsWith(github.ref, 'refs/tags')
shell: bash
run: echo "SKIP_TESTS_OPT=-DskipTests" >> $GITHUB_ENV

- name: mvn clean verify
run: ./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e $SKIP_TESTS_OPT

- name: Upload daemon test logs
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v2
with:
name: daemon-test-logs-linux
path: integration-tests/target/mvnd-tests/**/daemon*.log

- name: Upload mvnd.zip
uses: actions/upload-artifact@v2
with:
name: mvnd-linux-amd64.zip
path: dist/target/mvnd-*.zip

windows-jdk16:
runs-on: windows-2019
steps:

- name: setup-graalvm-ce
uses: DeLaGuardo/setup-graalvm@8bbfe44ef9c6f5c07e5af036a1bffd561c037d18
with:
graalvm-version: ${{ env.GRAALVM_VERSION }}

- name: gu install native-image
shell: cmd
run: gu install native-image

- uses: actions/cache@v2
with:
path: ${{ env.JAVA_HOME }}\bin\native-image.exe
key: ${{ runner.os }}-native-image-${{ env.GRAALVM_VERSION }}

- name: Check if native-image.exe exists
id: native_image_exe_exists
uses: andstor/file-existence-action@v1
with:
files: ${{ env.JAVA_HOME }}\bin\native-image.exe

- name: Compile native-image.cmd to native-image.exe
if: ${{ steps.native_image_exe_exists.outputs.files_exists == 'false' }}
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
"%JAVA_HOME%\bin\native-image.cmd" -jar "%JAVA_HOME%\lib\graalvm\svm-driver.jar" native-image

- name: move native-image.exe %JAVA_HOME%\bin\
if: ${{ steps.native_image_exe_exists.outputs.files_exists == 'false' }}
shell: cmd
run: |
move native-image.exe "%JAVA_HOME%\bin\"

- uses: actions/checkout@v1

- name: Set VERSION env var
shell: bash
run: echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: Skip tests when releasing from a tag
if: startsWith(github.ref, 'refs/tags')
shell: bash
run: echo "SKIP_TESTS_OPT=-DskipTests" >> $GITHUB_ENV

- name: mvn clean verify
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e %SKIP_TESTS_OPT%

- name: Upload daemon test logs
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v2
with:
name: daemon-test-logs-windows
path: integration-tests/target/mvnd-tests/**/daemon*.log

- name: Upload mvnd.zip
uses: actions/upload-artifact@v2
with:
name: mvnd-windows-amd64.zip
path: dist/target/mvnd-*.zip

darwin-jdk16:
runs-on: macos-10.15
steps:

- uses: actions/checkout@v1

- name: Set VERSION env var
run: echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: setup-graalvm-ce
uses: DeLaGuardo/setup-graalvm@8bbfe44ef9c6f5c07e5af036a1bffd561c037d18
with:
graalvm-version: ${{ env.GRAALVM_VERSION }}

- name: gu install native-image
run: gu install native-image

- name: Skip tests when releasing from a tag
if: startsWith(github.ref, 'refs/tags')
shell: bash
run: echo "SKIP_TESTS_OPT=-DskipTests" >> $GITHUB_ENV

- name: mvn clean verify
run: ./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e $SKIP_TESTS_OPT

- name: Upload daemon test logs
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v2
with:
name: daemon-test-logs-darwin
path: integration-tests/target/mvnd-tests/**/daemon*.log

- name: Upload mvnd.zip
uses: actions/upload-artifact@v2
with:
name: mvnd-darwin-amd64.zip
path: dist/target/mvnd-*.zip

Expand Up @@ -380,7 +380,10 @@ private Process startDaemonProcess(String daemonId) {
ProcessBuilder processBuilder = new ProcessBuilder();
processBuilder.environment()
.put("JDK_JAVA_OPTIONS",
"--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED");
"--add-opens java.base/java.io=ALL-UNNAMED " +
"--add-opens java.base/java.lang=ALL-UNNAMED " +
"--add-opens java.base/java.util=ALL-UNNAMED " +
"--add-opens java.base/sun.nio.fs=ALL-UNNAMED");
Process process = processBuilder
.directory(workingDir.toFile())
.command(args)
Expand Down
14 changes: 14 additions & 0 deletions daemon/pom.xml
Expand Up @@ -111,6 +111,20 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<argLine>
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/sun.nio.fs=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Expand Up @@ -59,6 +59,8 @@ void cleanInstall() throws IOException, InterruptedException {
String pathStr = dir.toAbsolutePath().toString();
assertTrue(output.getMessages().stream()
.anyMatch(m -> m.toString().contains(pathStr)), "Output should contain " + pathStr);
assertTrue(output.getMessages().stream()
.noneMatch(m -> m.toString().contains("Environment mismatch")));
}
assertDaemonRegistrySize(1);
}
Expand Down