From aa6297043f2120b6d2041dbc440d573b59591116 Mon Sep 17 00:00:00 2001 From: Yuntong Qu Date: Tue, 27 Jan 2026 01:08:32 -0500 Subject: [PATCH 1/6] Add missing CI jobs to GitHub Actions The GitHub Actions CI workflow was missing several checks present in Circle CI. This adds: 1. Java 8 client unit tests - verifies client compatibility with Java 8 2. Deb package build/install - verifies Debian package builds and installs 3. RPM package build/install - verifies RPM package builds and installs 4. Docker build - verifies Docker image builds with Jib 5. Documentation build - verifies docs build with Asciidoctor Also includes the checkstyle job added earlier to catch style violations. This ensures GitHub Actions green status implies Circle CI will also pass. --- .github/workflows/ci.yml | 241 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecb0a55b4..5201996f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,51 @@ jobs: path: cassandra-tarballs/ retention-days: 30 + # Run checkstyle checks for code style validation + checkstyle: + name: Checkstyle + runs-on: ubuntu-latest + needs: build-dtest-jars + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Setup Java 11 + uses: actions/setup-java@v5 + with: + java-version: "11" + distribution: "temurin" + cache: "gradle" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} + + - name: Download dtest jars + uses: actions/download-artifact@v5 + with: + name: dtest-jars + path: dtest-jars/ + + - name: Run checkstyle + run: | + ./gradlew checkstyleMain checkstyleTest checkstyleTestFixtures checkstyleIntegrationTest --stacktrace + env: + CASSANDRA_DEP_DIR: ${{ github.workspace }}/dtest-jars + + - name: Upload checkstyle reports + if: always() + uses: actions/upload-artifact@v5 + with: + name: checkstyle-reports + path: | + **/build/reports/checkstyle/ + retention-days: 30 + # Run unit tests with static analysis on all Java versions unit-tests: name: Unit tests (Java ${{ matrix.java }}) @@ -347,3 +392,199 @@ jobs: **/build/test-results/integrationTest*/** **/build/reports/tests/integrationTest*/ retention-days: 30 + + # Run Java 8 client unit tests for client compatibility + unit-tests-java8: + name: Unit tests (Java 8 - Client only) + runs-on: ubuntu-latest + permissions: + contents: read + checks: write + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Setup Java 8 + uses: actions/setup-java@v5 + with: + java-version: "8" + distribution: "temurin" + cache: "gradle" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} + + - name: Install prerequisites + run: | + sudo apt-get update + sudo apt-get install -y ant + + - name: Run build + run: | + ./gradlew build --stacktrace + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v5 + with: + name: unit-test-results-java-8 + path: | + **/build/test-results/test/** + **/build/reports/tests/ + retention-days: 30 + + # Build and verify Debian package + deb-build-install: + name: Deb package build and install + runs-on: ubuntu-latest + needs: [unit-tests, checkstyle] + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Setup Java 11 + uses: actions/setup-java@v5 + with: + java-version: "11" + distribution: "temurin" + cache: "gradle" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} + + - name: Build Debian package + run: | + ./gradlew --info clean buildDeb + + - name: Install Debian package + run: | + sudo apt-get update + sudo apt --fix-broken install + DEBIAN_FRONTEND=noninteractive sudo apt install -y ./build/distributions/apache-cassandra-sidecar*.deb + + - name: Verify installation + run: | + test -f /opt/apache-cassandra-sidecar/bin/cassandra-sidecar + test -f /opt/apache-cassandra-sidecar/conf/sidecar.yaml + test -f /opt/apache-cassandra-sidecar/conf/logback.xml + test -f /opt/apache-cassandra-sidecar/LICENSE.txt + test -f /opt/apache-cassandra-sidecar/lib/cassandra-sidecar-*.jar + + # Build and verify RPM package + rpm-build-install: + name: RPM package build and install + runs-on: ubuntu-latest + needs: [unit-tests, checkstyle] + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Setup Java 11 + uses: actions/setup-java@v5 + with: + java-version: "11" + distribution: "temurin" + cache: "gradle" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} + + - name: Install dnf + run: | + sudo apt-get update + sudo apt-get install -y dnf + + - name: Build RPM package + run: | + ./gradlew -i buildRpm + + - name: Install RPM package + run: | + sudo dnf install -y ./build/distributions/apache-cassandra-sidecar*.rpm + + - name: Verify installation + run: | + test -f /opt/apache-cassandra-sidecar/bin/cassandra-sidecar + test -f /opt/apache-cassandra-sidecar/conf/sidecar.yaml + test -f /opt/apache-cassandra-sidecar/conf/logback.xml + test -f /opt/apache-cassandra-sidecar/LICENSE.txt + test -f /opt/apache-cassandra-sidecar/lib/cassandra-sidecar-*.jar + + # Build Docker image + docker-build: + name: Docker build + runs-on: ubuntu-latest + needs: [unit-tests, checkstyle] + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Setup Java 11 + uses: actions/setup-java@v5 + with: + java-version: "11" + distribution: "temurin" + cache: "gradle" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} + + - name: Build Docker image with Jib + run: | + ./gradlew --info clean :server:jibDockerBuild + + # Build documentation + docs-build: + name: Documentation build + runs-on: ubuntu-latest + needs: [unit-tests, checkstyle] + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Setup Java 11 + uses: actions/setup-java@v5 + with: + java-version: "11" + distribution: "temurin" + cache: "gradle" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + with: + cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} + + - name: Install prerequisites + run: | + sudo apt-get update + sudo apt-get install -y ant + + - name: Build documentation + run: | + ./gradlew docs:asciidoctor + + - name: Verify documentation + run: | + test -f docs/build/user.html + test -f docs/build/development.html From d4d23b64f49d036d50ac9633a26b8f517ddc8b2c Mon Sep 17 00:00:00 2001 From: yqu63 Date: Tue, 27 Jan 2026 14:22:23 -0500 Subject: [PATCH 2/6] Clean up CI workflow: remove unnecessary steps and simplify commands --- .github/workflows/ci.yml | 45 ++++++++++------------------------------ 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5201996f9..3bc78ea8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,8 +129,7 @@ jobs: path: dtest-jars/ - name: Run checkstyle - run: | - ./gradlew checkstyleMain checkstyleTest checkstyleTestFixtures checkstyleIntegrationTest --stacktrace + run: ./gradlew checkstyleMain checkstyleTest checkstyleTestFixtures checkstyleIntegrationTest --stacktrace env: CASSANDRA_DEP_DIR: ${{ github.workspace }}/dtest-jars @@ -139,8 +138,7 @@ jobs: uses: actions/upload-artifact@v5 with: name: checkstyle-reports - path: | - **/build/reports/checkstyle/ + path: "**/build/reports/checkstyle/" retention-days: 30 # Run unit tests with static analysis on all Java versions @@ -417,14 +415,8 @@ jobs: with: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - - name: Install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y ant - - name: Run build - run: | - ./gradlew build --stacktrace + run: ./gradlew build --stacktrace - name: Upload test results if: always() @@ -461,13 +453,11 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - name: Build Debian package - run: | - ./gradlew --info clean buildDeb + run: ./gradlew --info clean buildDeb - name: Install Debian package run: | - sudo apt-get update - sudo apt --fix-broken install + sudo apt-get update && sudo apt --fix-broken install DEBIAN_FRONTEND=noninteractive sudo apt install -y ./build/distributions/apache-cassandra-sidecar*.deb - name: Verify installation @@ -503,17 +493,13 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - name: Install dnf - run: | - sudo apt-get update - sudo apt-get install -y dnf + run: sudo apt-get update && sudo apt-get install -y dnf - name: Build RPM package - run: | - ./gradlew -i buildRpm + run: ./gradlew -i buildRpm - name: Install RPM package - run: | - sudo dnf install -y ./build/distributions/apache-cassandra-sidecar*.rpm + run: sudo dnf install -y ./build/distributions/apache-cassandra-sidecar*.rpm - name: Verify installation run: | @@ -548,8 +534,7 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - name: Build Docker image with Jib - run: | - ./gradlew --info clean :server:jibDockerBuild + run: ./gradlew --info clean :server:jibDockerBuild # Build documentation docs-build: @@ -575,16 +560,8 @@ jobs: with: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - - name: Install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y ant - - name: Build documentation - run: | - ./gradlew docs:asciidoctor + run: ./gradlew docs:asciidoctor - name: Verify documentation - run: | - test -f docs/build/user.html - test -f docs/build/development.html + run: test -f docs/build/user.html && test -f docs/build/development.html From 78df2475a126c0e69833adde347a076492ab1d9d Mon Sep 17 00:00:00 2001 From: Yuntong Qu Date: Tue, 27 Jan 2026 16:34:04 -0500 Subject: [PATCH 3/6] Update CHANGES.txt --- CHANGES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.txt b/CHANGES.txt index 8acfc8819..e76328fa5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,6 @@ 0.3.0 ----- + * Add Missing checks in GitHub actions vs Cicle CI (CASSSIDECAR-397) * Database access during auth flow is blocking event-loop thread (CASSSIDECAR-369) * Add default process-based lifecycle provider (CASSSIDECAR-340) * Sidecar API Endpoint for Nodetool Compaction Stop (CASSSIDECAR-360) From ac5f53ffaf919e51b9a9dd32f6e3eb911689a513 Mon Sep 17 00:00:00 2001 From: Yuntong Qu Date: Wed, 28 Jan 2026 22:16:33 -0500 Subject: [PATCH 4/6] Address review feedback for CI checks Simplifies checkstyle invocation and removes CI-only notes from CHANGES for consistency. --- .github/workflows/ci.yml | 3 ++- CHANGES.txt | 1 - build.gradle | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bc78ea8d..9b7e1c2e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,8 @@ jobs: path: dtest-jars/ - name: Run checkstyle - run: ./gradlew checkstyleMain checkstyleTest checkstyleTestFixtures checkstyleIntegrationTest --stacktrace + run: | + ./gradlew checkstyle --stacktrace env: CASSANDRA_DEP_DIR: ${{ github.workspace }}/dtest-jars diff --git a/CHANGES.txt b/CHANGES.txt index e76328fa5..8acfc8819 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,5 @@ 0.3.0 ----- - * Add Missing checks in GitHub actions vs Cicle CI (CASSSIDECAR-397) * Database access during auth flow is blocking event-loop thread (CASSSIDECAR-369) * Add default process-based lifecycle provider (CASSSIDECAR-340) * Sidecar API Endpoint for Nodetool Compaction Stop (CASSSIDECAR-360) diff --git a/build.gradle b/build.gradle index 8943007c6..032f8ab04 100644 --- a/build.gradle +++ b/build.gradle @@ -111,6 +111,12 @@ ext { // Force checkstyle, rat, and spotBugs to run before test tasks for faster feedback def codeCheckTasks = task("codeCheckTasks") +tasks.register('checkstyle') { + description = 'Runs all checkstyle tasks' + group = 'verification' + dependsOn tasks.withType(Checkstyle) +} + allprojects { apply plugin: 'jacoco' apply plugin: 'checkstyle' From ff48bd86e8636f653c8f2ce330dc67983dd92683 Mon Sep 17 00:00:00 2001 From: Yuntong Qu Date: Wed, 28 Jan 2026 22:20:31 -0500 Subject: [PATCH 5/6] Apply suggestion from @frankgh Co-authored-by: Francisco Guerrero --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b7e1c2e1..5cbb3942b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -565,4 +565,6 @@ jobs: run: ./gradlew docs:asciidoctor - name: Verify documentation - run: test -f docs/build/user.html && test -f docs/build/development.html + run: | + test -f docs/build/user.html + test -f docs/build/development.html From 061f6405f52f57e1fd0c62e0329bd71c2144bc0f Mon Sep 17 00:00:00 2001 From: Yuntong Qu Date: Thu, 29 Jan 2026 00:01:13 -0500 Subject: [PATCH 6/6] format and checkstyle gradlew task (#5) * Remove unnecessary dtest-jars dependency from checkstyle job Checkstyle is a static analysis tool that runs directly on source files without needing compiled classes or Cassandra dependencies. Removing the dependency on build-dtest-jars allows checkstyle to run immediately in parallel, providing faster feedback on code style issues. * Restore dtest-jars dependency for checkstyle job The test-common:checkstyleTestFixtures task requires compiling testFixtures first, which depends on Cassandra dtest jars for import resolution. * Match CircleCI: use full build for Java 8 unit tests CircleCI runs './gradlew build' which relies on Gradle's Java version checking to skip server modules that require Java 11+. * Format run commands with pipe style for consistency --- .github/workflows/ci.yml | 21 ++++++++++++++------- build.gradle | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cbb3942b..6667bfea4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -417,7 +417,8 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - name: Run build - run: ./gradlew build --stacktrace + run: | + ./gradlew build --stacktrace - name: Upload test results if: always() @@ -454,7 +455,8 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - name: Build Debian package - run: ./gradlew --info clean buildDeb + run: | + ./gradlew --info clean buildDeb - name: Install Debian package run: | @@ -494,13 +496,16 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - name: Install dnf - run: sudo apt-get update && sudo apt-get install -y dnf + run: | + sudo apt-get update && sudo apt-get install -y dnf - name: Build RPM package - run: ./gradlew -i buildRpm + run: | + ./gradlew -i buildRpm - name: Install RPM package - run: sudo dnf install -y ./build/distributions/apache-cassandra-sidecar*.rpm + run: | + sudo dnf install -y ./build/distributions/apache-cassandra-sidecar*.rpm - name: Verify installation run: | @@ -535,7 +540,8 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - name: Build Docker image with Jib - run: ./gradlew --info clean :server:jibDockerBuild + run: | + ./gradlew --info clean :server:jibDockerBuild # Build documentation docs-build: @@ -562,7 +568,8 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/trunk' }} - name: Build documentation - run: ./gradlew docs:asciidoctor + run: | + ./gradlew docs:asciidoctor - name: Verify documentation run: | diff --git a/build.gradle b/build.gradle index 032f8ab04..372869eb3 100644 --- a/build.gradle +++ b/build.gradle @@ -114,7 +114,7 @@ def codeCheckTasks = task("codeCheckTasks") tasks.register('checkstyle') { description = 'Runs all checkstyle tasks' group = 'verification' - dependsOn tasks.withType(Checkstyle) + dependsOn(allprojects.collect { it.tasks.withType(Checkstyle) }) } allprojects {