Skip to content

Commit

Permalink
Combine into one yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
LuQQiu committed Jun 11, 2024
1 parent 1420c3a commit 7730220
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 109 deletions.
70 changes: 65 additions & 5 deletions .github/workflows/java_17.yml → .github/workflows/java.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build and Run Java 17 JNI Tests
name: Build and Run Java JNI Tests

on:
push:
branches:
Expand All @@ -7,7 +8,8 @@ on:
paths:
- java/**
- rust/**
- .github/workflows/java_17.yml
- .github/workflows/java_jni_tests.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.
Expand All @@ -20,8 +22,67 @@ env:
# CI builds are faster with incremental disabled.
CARGO_INCREMENTAL: "0"
CARGO_BUILD_JOBS: "1"

jobs:
linux-build:
build-and-test-java-11:
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

build-and-test-java-8:
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"
- name: Running tests with Java 8
run: mvn clean test

build-and-test-java-17:
runs-on: ubuntu-22.04
name: ubuntu-22.04 + Java 17
defaults:
Expand All @@ -43,7 +104,6 @@ jobs:
distribution: temurin
java-version: 17
cache: "maven"
- run: echo "JAVA_17=$JAVA_HOME" >> $GITHUB_ENV
- name: Running tests with Java 17
run: |
export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS \
Expand All @@ -65,4 +125,4 @@ jobs:
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED \
-Djdk.reflect.useDirectMethodHandle=false \
-Dio.netty.tryReflectionSetAccessible=true"
JAVA_HOME=$JAVA_17 mvn clean test
mvn clean test
55 changes: 0 additions & 55 deletions .github/workflows/java_11.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/java_8.yml

This file was deleted.

0 comments on commit 7730220

Please sign in to comment.