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

Test on Linux, Mac, and Windows #81

Merged
merged 2 commits into from
Mar 8, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 72 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,78 @@ on:
- 'README*'

jobs:
build:
build-linux:
runs-on: ubuntu-latest
name: build with JDK 11
name: build with JDK 11 (Linux)

steps:
- uses: actions/checkout@v2
name: checkout

- uses: AdoptOpenJDK/install-jdk@v1
name: set up JDK 11
with:
version: 11

- uses: AdoptOpenJDK/install-jdk@v1
name: set up JDK 10
with:
version: 10
targets: 'JAVA_HOME_10'

- uses: AdoptOpenJDK/install-jdk@v1
name: set up JDK 9
with:
version: 9
targets: 'JAVA_HOME_9'

- uses: AdoptOpenJDK/install-jdk@v1
name: set up JDK 8
with:
version: 8
targets: 'JAVA_HOME_8'

- name: build with maven
run: mvn -B formatter:validate verify --file pom.xml -Djava8.home=$JAVA_HOME_8 -Djava9.home=$JAVA_HOME_9 -Djava10.home=$JAVA_HOME_10

build-windows:
runs-on: windows-latest
name: build with JDK 11 (Windows)

steps:
- uses: actions/checkout@v2
name: checkout

- uses: AdoptOpenJDK/install-jdk@v1
name: set up JDK 11
with:
version: 11

- uses: AdoptOpenJDK/install-jdk@v1
name: set up JDK 10
with:
version: 10
targets: 'JAVA_HOME_10'

- uses: AdoptOpenJDK/install-jdk@v1
name: set up JDK 9
with:
version: 9
targets: 'JAVA_HOME_9'

- uses: AdoptOpenJDK/install-jdk@v1
name: set up JDK 8
with:
version: 8
targets: 'JAVA_HOME_8'

- name: build with maven
shell: bash
run: mvn -B formatter:validate verify --file pom.xml -Djava8.home=$JAVA_HOME_8 -Djava9.home=$JAVA_HOME_9 -Djava10.home=$JAVA_HOME_10

build-macos:
runs-on: macos-latest
name: build with JDK 11 (Mac OS)

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -52,7 +121,7 @@ jobs:
run: mvn -B formatter:validate verify --file pom.xml -Djava8.home=$JAVA_HOME_8 -Djava9.home=$JAVA_HOME_9 -Djava10.home=$JAVA_HOME_10

quality:
needs: [build]
needs: [build-linux,build-macos,build-windows]
if: github.event_name == 'push' && github.repository == 'smallrye/smallrye-common'
runs-on: ubuntu-latest
name: quality
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -79,8 +80,8 @@ void processAsPath(@TempDir Path tempDir) throws Exception {
Path filePath = tempDir.resolve("resources.jar");
jar.as(ZipExporter.class).exportTo(filePath.toFile());

URL resource = new URL("jar:file:" + filePath.toString() + "!/resources.properties");
Properties properties = ClassPathUtils.processAsPath(resource, path -> {
URI resource = new URI("jar", filePath.toUri().toASCIIString() + "!/resources.properties", null);
Properties properties = ClassPathUtils.processAsPath(resource.toURL(), path -> {
Properties properties1 = new Properties();
try (InputStreamReader reader = new InputStreamReader(Files.newInputStream(path))) {
properties1.load(reader);
Expand All @@ -102,8 +103,8 @@ void readStream(@TempDir Path tempDir) throws Exception {
Path filePath = tempDir.resolve("resources.jar");
jar.as(ZipExporter.class).exportTo(filePath.toFile());

URL resource = new URL("jar:file:" + filePath.toString() + "!/resources.properties");
Properties properties = ClassPathUtils.readStream(resource, inputStream -> {
URI resource = new URI("jar", filePath.toUri().toASCIIString() + "!/resources.properties", null);
Properties properties = ClassPathUtils.readStream(resource.toURL(), inputStream -> {
Properties properties1 = new Properties();
try (InputStreamReader reader = new InputStreamReader(inputStream)) {
properties1.load(reader);
Expand Down