diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d23141a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: build +on: [push] + +jobs: + build: + strategy: + matrix: + include: + - os: ubuntu-latest + java-version: 8 + path-sep: ":" + - os: ubuntu-latest + java-version: 11 + path-sep: ":" + - os: ubuntu-latest + java-version: 17 + path-sep: ":" + - os: windows-latest + java-version: 11 + path-sep: ";" + - os: macos-latest + java-version: 11 + path-sep: ":" + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} + Java ${{ matrix.java-version }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # https://github.com/actions/setup-java + - name: Install Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: ${{ matrix.java-version }} + cache: 'maven' + + - name: Build with Maven + run: mvn package + + - name: Runnig the example + run: java -cp "./rust-maven-example/target/rust-maven-example-1.0.0-SNAPSHOT.jar${{ matrix.path-sep }}./jar-jni/target/jar-jni-1.0.0-SNAPSHOT.jar" io.questdb.rust.maven.example.Main diff --git a/rust-maven-plugin/src/main/java/io/questdb/rust/maven/plugin/CargoInstalledChecker.java b/rust-maven-plugin/src/main/java/io/questdb/rust/maven/plugin/CargoInstalledChecker.java index 78199da..12c68af 100644 --- a/rust-maven-plugin/src/main/java/io/questdb/rust/maven/plugin/CargoInstalledChecker.java +++ b/rust-maven-plugin/src/main/java/io/questdb/rust/maven/plugin/CargoInstalledChecker.java @@ -27,6 +27,7 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.Log; +import java.io.File; import java.util.HashMap; public final class CargoInstalledChecker { @@ -81,7 +82,7 @@ public synchronized void check(Log log, String cargoPath) if (cargoPath.equals("cargo")) { error .append("Rust's `cargo` not found in PATH=") - .append(Shlex.quote(System.getenv("PATH"))); + .append(Shlex.quote(String.join(File.pathSeparator, System.getenv("PATH")))); } else { error .append("Rust's `cargo` not found at ")