From 9e5ec3c0c881ca5c99797d3e5ec030736065cb3f Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:17:26 +0530 Subject: [PATCH 1/4] ci: bump actions/setup-java to v5 --- .github/actions/setup-java/action.yml | 2 +- .github/workflows/publish-java.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-java/action.yml b/.github/actions/setup-java/action.yml index 5e172d29..2e5c8a93 100644 --- a/.github/actions/setup-java/action.yml +++ b/.github/actions/setup-java/action.yml @@ -15,7 +15,7 @@ runs: using: composite steps: - name: Install JDK + Gradle cache - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: ${{ inputs.java-version }} diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index 735b3df6..7a46aec7 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -126,7 +126,7 @@ jobs: persist-credentials: false - name: Set up JDK - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: "21" From 28dc5f3201754e006bd4e56ddf37e76590da12c3 Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:17:27 +0530 Subject: [PATCH 2/4] ci: test Java SDK across JDK 11/17/21 --- .github/workflows/ci-java.yml | 60 +++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-java.yml b/.github/workflows/ci-java.yml index 0a728753..6954eb85 100644 --- a/.github/workflows/ci-java.yml +++ b/.github/workflows/ci-java.yml @@ -1,9 +1,9 @@ name: CI Java -# Reusable workflow: build the JNI cdylib (via Gradle's cargoBuild) and run the -# Java SDK's full `gradle build` — compile, Spotless + Checkstyle, and the JUnit -# suite across the runtime, processor, and test-support subprojects. Called by -# ci.yml when Java-relevant paths change. +# Reusable workflow for the Java SDK. The JNI cdylib is built once (it's +# identical for every consumer JDK), then the full `gradle build` — compile +# (`--release 11`), Spotless + Checkstyle, and the JUnit suite — runs against +# each supported JDK runtime. Called by ci.yml when Java-relevant paths change. on: workflow_call: @@ -15,8 +15,11 @@ env: CARGO_NET_RETRY: "10" jobs: - java-test: - name: Java SDK Tests + # Compile the native library once and hand it to every test leg as an + # artifact. The .so does not depend on the JDK, so rebuilding it per matrix + # entry would only burn runner minutes. + native: + name: Build native library runs-on: ubuntu-latest steps: - name: Check out repository @@ -25,12 +28,49 @@ jobs: - name: Set up Rust uses: ./.github/actions/setup-rust + - name: Build the JNI cdylib + run: cargo build --release --features postgres,redis,workflows -p taskito-java + + - name: Upload the cdylib + uses: actions/upload-artifact@v7 + with: + name: taskito-java-native + path: target/release/libtaskito_java.so + if-no-files-found: error + retention-days: 1 + + # Run compile + lint + the JUnit suite on every supported JDK runtime. The + # SDK targets Java 11 but is consumed on 11/17/21 and loads a native .so, so + # JVM behaviour is runtime-sensitive — green on one JDK is not green on all. + # fail-fast is off so one JDK's failures don't mask another's. + test: + name: Java SDK Tests (JDK ${{ matrix.java }}) + needs: native + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: ["11", "17", "21"] + steps: + - name: Check out repository + uses: actions/checkout@v7 + - name: Set up Java + Gradle uses: ./.github/actions/setup-java + with: + java-version: ${{ matrix.java }} + + # Stage the prebuilt library where Gradle's copyNative expects it + # (../../target/release from sdks/java), so the build needs no Rust. + - name: Download the cdylib + uses: actions/download-artifact@v8 + with: + name: taskito-java-native + path: target/release - # `gradle build` runs cargoBuild (the JNI cdylib), staging the native - # library into the jar, then compile + Spotless + Checkstyle + tests for - # every subproject. --no-daemon keeps the runner clean. + # `-x cargoBuild` skips the Rust compile; copyNative still stages the + # downloaded .so into the jar before compile + Spotless + Checkstyle + + # tests run. --no-daemon keeps the runner clean. - name: Build and test the Java SDK working-directory: sdks/java - run: ./gradlew build --no-daemon + run: ./gradlew build -x cargoBuild --no-daemon From cc7262b64045aff7eb49dfef997775bd1a841817 Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:21:20 +0530 Subject: [PATCH 3/4] ci: smoke-build Java SDK on macOS arm64 + Windows --- .github/workflows/ci-java.yml | 59 +++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-java.yml b/.github/workflows/ci-java.yml index 6954eb85..a4f6d404 100644 --- a/.github/workflows/ci-java.yml +++ b/.github/workflows/ci-java.yml @@ -1,9 +1,8 @@ name: CI Java -# Reusable workflow for the Java SDK. The JNI cdylib is built once (it's -# identical for every consumer JDK), then the full `gradle build` — compile -# (`--release 11`), Spotless + Checkstyle, and the JUnit suite — runs against -# each supported JDK runtime. Called by ci.yml when Java-relevant paths change. +# Reusable Java SDK workflow: Linux runs the full `gradle build` across every +# JDK (sharing one prebuilt cdylib); a smoke build covers the other published +# platforms. Called by ci.yml when Java-relevant paths change. on: workflow_call: @@ -15,9 +14,7 @@ env: CARGO_NET_RETRY: "10" jobs: - # Compile the native library once and hand it to every test leg as an - # artifact. The .so does not depend on the JDK, so rebuilding it per matrix - # entry would only burn runner minutes. + # Build the JDK-independent cdylib once; test legs reuse it as an artifact. native: name: Build native library runs-on: ubuntu-latest @@ -39,10 +36,8 @@ jobs: if-no-files-found: error retention-days: 1 - # Run compile + lint + the JUnit suite on every supported JDK runtime. The - # SDK targets Java 11 but is consumed on 11/17/21 and loads a native .so, so - # JVM behaviour is runtime-sensitive — green on one JDK is not green on all. - # fail-fast is off so one JDK's failures don't mask another's. + # Build + test on every supported JDK; the SDK targets 11 but runs on 11/17/21 + # over a native .so, so JVM behaviour is runtime-sensitive. test: name: Java SDK Tests (JDK ${{ matrix.java }}) needs: native @@ -60,17 +55,49 @@ jobs: with: java-version: ${{ matrix.java }} - # Stage the prebuilt library where Gradle's copyNative expects it - # (../../target/release from sdks/java), so the build needs no Rust. + # Stage the prebuilt .so where copyNative expects it, so no Rust is needed. - name: Download the cdylib uses: actions/download-artifact@v8 with: name: taskito-java-native path: target/release - # `-x cargoBuild` skips the Rust compile; copyNative still stages the - # downloaded .so into the jar before compile + Spotless + Checkstyle + - # tests run. --no-daemon keeps the runner clean. + # -x cargoBuild skips the Rust compile; copyNative still stages the .so. - name: Build and test the Java SDK working-directory: sdks/java run: ./gradlew build -x cargoBuild --no-daemon + + # Smoke the other published platforms on one JDK: their native binary differs, + # so they rebuild it (cargoBuild) instead of reusing the Linux artifact. + smoke: + name: Java SDK Smoke (${{ matrix.classifier }}) + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - classifier: osx-aarch64 + runner: macos-15 + - classifier: windows-x86_64 + runner: windows-latest + steps: + - name: Check out repository + uses: actions/checkout@v7 + + # Vendored OpenSSL needs Perl; point openssl-sys at Strawberry Perl. + - name: Point vendored OpenSSL at Strawberry Perl (Windows) + if: runner.os == 'Windows' + shell: bash + run: echo "OPENSSL_SRC_PERL=C:/Strawberry/perl/bin/perl.exe" >> "$GITHUB_ENV" + + - name: Set up Rust + uses: ./.github/actions/setup-rust + + - name: Set up Java + Gradle + uses: ./.github/actions/setup-java + + # bash so `./gradlew` runs uniformly on the Windows runner too. + - name: Build and test the Java SDK + working-directory: sdks/java + shell: bash + run: ./gradlew build --no-daemon From dd4e02ffae6f32fc3f36c3af99acd76c578a3e48 Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:48:55 +0530 Subject: [PATCH 4/4] ci: delete all PR caches, not just first 30 --- .github/workflows/cleanup.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 1e53c2eb..4d367c41 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -10,14 +10,15 @@ jobs: permissions: actions: write steps: - - uses: actions/checkout@v7 - + # Delete every cache scoped to the PR's merge ref in one call. --all avoids + # `gh cache list`'s 30-entry cap; --succeed-on-no-caches exits 0 when the + # PR left none, without masking real failures the way `|| true` would. - name: Delete PR branch caches env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge - run: | - echo "Deleting caches for branch: $BRANCH" - gh cache list --ref "$BRANCH" --json id --jq '.[].id' | - xargs -I {} gh cache delete {} --repo "${{ github.repository }}" || true - echo "Done" + run: >- + gh cache delete --all + --ref "$BRANCH" + --repo "${{ github.repository }}" + --succeed-on-no-caches