From 1420c3ab657ac36a77a2654409934d669995d6c4 Mon Sep 17 00:00:00 2001 From: Lu Qiu Date: Sat, 8 Jun 2024 22:25:31 -0700 Subject: [PATCH] separate java builds --- .github/workflows/java_11.yml | 55 +++++++++++++++++++++ .github/workflows/{java.yml => java_17.yml} | 31 ++---------- .github/workflows/java_8.yml | 49 ++++++++++++++++++ 3 files changed, 107 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/java_11.yml rename .github/workflows/{java.yml => java_17.yml} (72%) create mode 100644 .github/workflows/java_8.yml diff --git a/.github/workflows/java_11.yml b/.github/workflows/java_11.yml new file mode 100644 index 0000000000..e0c870acc9 --- /dev/null +++ b/.github/workflows/java_11.yml @@ -0,0 +1,55 @@ +name: Build and Run Java 11 JNI Tests +on: + push: + branches: + - main + pull_request: + paths: + - java/** + - rust/** + - .github/workflows/java_11.yml +env: + # This env var is used by Swatinem/rust-cache@v2 for the cache + # key, so we set it to make sure it is always consistent. + CARGO_TERM_COLOR: always + # Disable full debug symbol generation to speed up CI build and keep memory down + # "1" means line tables only, which is useful for panic tracebacks. + RUSTFLAGS: "-C debuginfo=1" + RUST_BACKTRACE: "1" + # according to: https://matklad.github.io/2021/09/04/fast-rust-builds.html + # CI builds are faster with incremental disabled. + CARGO_INCREMENTAL: "0" + CARGO_BUILD_JOBS: "1" +jobs: + linux-build: + runs-on: ubuntu-22.04 + name: ubuntu-22.04 + Java 11 + defaults: + run: + working-directory: ./java + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + with: + workspaces: java/java-jni + - name: Run cargo fmt + run: cargo fmt --check + working-directory: ./java/core/lance-jni + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y protobuf-compiler libssl-dev + - name: Install Java 11 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 11 + cache: "maven" + - name: Java Style Check + run: mvn checkstyle:check + - name: Rust Clippy + working-directory: java/core/lance-jni + run: cargo clippy --all-targets -- -D warnings + - name: Running tests with Java 11 + run: mvn clean test \ No newline at end of file diff --git a/.github/workflows/java.yml b/.github/workflows/java_17.yml similarity index 72% rename from .github/workflows/java.yml rename to .github/workflows/java_17.yml index a7a533fd8a..fd0b66e95e 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java_17.yml @@ -1,4 +1,4 @@ -name: Build and Run Java JNI Tests +name: Build and Run Java 17 JNI Tests on: push: branches: @@ -7,7 +7,7 @@ on: paths: - java/** - rust/** - - .github/workflows/java.yml + - .github/workflows/java_17.yml env: # This env var is used by Swatinem/rust-cache@v2 for the cache # key, so we set it to make sure it is always consistent. @@ -23,7 +23,7 @@ env: jobs: linux-build: runs-on: ubuntu-22.04 - name: ubuntu-22.04 + Java 11 & 17 + name: ubuntu-22.04 + Java 17 defaults: run: working-directory: ./java @@ -33,9 +33,6 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: java/java-jni - - name: Run cargo fmt - run: cargo fmt --check - working-directory: ./java/core/lance-jni - name: Install dependencies run: | sudo apt update @@ -47,28 +44,6 @@ jobs: java-version: 17 cache: "maven" - run: echo "JAVA_17=$JAVA_HOME" >> $GITHUB_ENV - - name: Install Java 8 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 8 - cache: "maven" - - run: echo "JAVA_8=$JAVA_HOME" >> $GITHUB_ENV - - name: Install Java 11 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 11 - cache: "maven" - - name: Java Style Check - run: mvn checkstyle:check - - name: Rust Clippy - working-directory: java/core/lance-jni - run: cargo clippy --all-targets -- -D warnings - - name: Running tests with Java 11 - run: mvn clean test - - name: Running tests with Java 8 - run: JAVA_HOME=$JAVA_8 mvn clean test - name: Running tests with Java 17 run: | export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS \ diff --git a/.github/workflows/java_8.yml b/.github/workflows/java_8.yml new file mode 100644 index 0000000000..7a4e8c3040 --- /dev/null +++ b/.github/workflows/java_8.yml @@ -0,0 +1,49 @@ +name: Build and Run Java 8 JNI Tests +on: + push: + branches: + - main + pull_request: + paths: + - java/** + - rust/** + - .github/workflows/java_8.yml +env: + # This env var is used by Swatinem/rust-cache@v2 for the cache + # key, so we set it to make sure it is always consistent. + CARGO_TERM_COLOR: always + # Disable full debug symbol generation to speed up CI build and keep memory down + # "1" means line tables only, which is useful for panic tracebacks. + RUSTFLAGS: "-C debuginfo=1" + RUST_BACKTRACE: "1" + # according to: https://matklad.github.io/2021/09/04/fast-rust-builds.html + # CI builds are faster with incremental disabled. + CARGO_INCREMENTAL: "0" + CARGO_BUILD_JOBS: "1" +jobs: + linux-build: + runs-on: ubuntu-22.04 + name: ubuntu-22.04 + Java 8 + defaults: + run: + working-directory: ./java + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + with: + workspaces: java/java-jni + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y protobuf-compiler libssl-dev + - name: Install Java 8 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 8 + cache: "maven" + - run: echo "JAVA_8=$JAVA_HOME" >> $GITHUB_ENV + - name: Running tests with Java 8 + run: JAVA_HOME=$JAVA_8 mvn clean test + \ No newline at end of file