This is an automated email from the ASF dual-hosted git repository.
piotr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git
The following commit(s) were added to refs/heads/master by this push:
new 9d3608d6 chore(ci): add CI pipeline for java-sdk (#1782)
9d3608d6 is described below
commit 9d3608d6f150c6fbe3801c2e70dc630e10ebb5a3
Author: Nandakumar Vadivelu <[email protected]>
AuthorDate: Tue May 13 23:57:25 2025 +0530
chore(ci): add CI pipeline for java-sdk (#1782)
Fixes #1781
This PR only adds `build` and `unit test` run to the CI flow.
The following checks will be added later
- Checkstyle verification, will be done after #1753
- Findbugs
- License header check
- Code coverage
- Shell check for scripts under foreign/java
---
.github/changed-files-config.json | 5 ++
.github/workflows/ci-check-java-sdk.yml | 81 ++++++++++++++++++++++++++++++++
.github/workflows/ci-check-pr.yml | 8 ++++
foreign/java/dev-support/checks/build.sh | 25 ++++++++++
4 files changed, 119 insertions(+)
diff --git a/.github/changed-files-config.json
b/.github/changed-files-config.json
index 07cf12b7..363ca268 100644
--- a/.github/changed-files-config.json
+++ b/.github/changed-files-config.json
@@ -18,5 +18,10 @@
"Cargo.lock",
"Dockerfile.*",
".github/workflows/ci-prod-rust.yml"
+ ],
+ "java-sdk": [
+ "foreign/java/.*\\.java",
+ "foreign/java/.*\\.sh",
+ ".github/workflows/ci-check-java-sdk.yml"
]
}
diff --git a/.github/workflows/ci-check-java-sdk.yml
b/.github/workflows/ci-check-java-sdk.yml
new file mode 100644
index 00000000..928051ef
--- /dev/null
+++ b/.github/workflows/ci-check-java-sdk.yml
@@ -0,0 +1,81 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+
+# -------------------------------------------------------------
+#
+# CI Check Java Workflow
+#
+# This workflow runs checks for Java code.
+# Checks include:
+# - Java Gradle build
+# - TODO: Add checkstyle verification, will be done after #1753
+# - TODO: Add findbugs
+# - TODO: License header check
+# - TODO: Add code coverage
+# - TODO: Add shell check for scripts under foreign/java
+#
+# This workflow can be triggered manually or by other workflows.
+#
+name: ci-check-java-sdk
+
+on:
+ workflow_dispatch:
+ workflow_call:
+
+jobs:
+ build:
+ name: Java build
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v4
+
+ - name: Setup Java
+ uses: actions/setup-java@v4
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+
+ # Configure Gradle for optimal use in GitHub Actions, including caching
of downloaded dependencies.
+ # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
+ - name: Setup Gradle
+ uses:
gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
+
+ - name: Build
+ run: foreign/java/dev-support/checks/build.sh build -x test
+
+ test:
+ name: Unit test
+ needs: build
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v4
+
+ - name: Setup Java
+ uses: actions/setup-java@v4
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+
+ # Configure Gradle for optimal use in GitHub Actions, including caching
of downloaded dependencies.
+ # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
+ - name: Setup Gradle
+ uses:
gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
+
+ - name: Run tests
+ run: foreign/java/dev-support/checks/build.sh test
diff --git a/.github/workflows/ci-check-pr.yml
b/.github/workflows/ci-check-pr.yml
index 73eda0c4..853c1ffb 100644
--- a/.github/workflows/ci-check-pr.yml
+++ b/.github/workflows/ci-check-pr.yml
@@ -55,6 +55,7 @@ jobs:
outputs:
trigger-rust: ${{ steps.changed-files.outputs.RUST_FILES_CHANGED }}
trigger-shell: ${{ steps.changed-files.outputs.SHELL_FILES_CHANGED }}
+ trigger-java-sdk: ${{ steps.changed-files.outputs.JAVA-SDK_FILES_CHANGED
}}
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -119,6 +120,12 @@ jobs:
if: ${{ needs.pr-file-changes.outputs.trigger-shell == 'true' }}
uses: ./.github/workflows/ci-check-shell.yml
+ ci-check-java-sdk:
+ name: ci-check-java-sdk
+ needs: pr-file-changes
+ if: ${{ needs.pr-file-changes.outputs.trigger-java-sdk == 'true' }}
+ uses: ./.github/workflows/ci-check-java-sdk.yml
+
finalize-pr:
runs-on: ubuntu-latest
needs:
@@ -128,6 +135,7 @@ jobs:
- ci-test-rust
- ci-compatibility-rust
- ci-check-shell
+ - ci-check-java-sdk
if: always()
steps:
- name: Everything is fine
diff --git a/foreign/java/dev-support/checks/build.sh
b/foreign/java/dev-support/checks/build.sh
new file mode 100755
index 00000000..081ca487
--- /dev/null
+++ b/foreign/java/dev-support/checks/build.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+cd "$DIR/../.." || exit 1
+
+task="${1:-build}"
+shift 1
+./gradlew "$task" "$@"
+exit $?