frankgh commented on code in PR #310:
URL: https://github.com/apache/cassandra-sidecar/pull/310#discussion_r2739247559
##########
.github/workflows/ci.yml:
##########
@@ -98,6 +98,49 @@ 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
Review Comment:
does it make sense to register a new task in the main `build.gradle` file to
run all checkstyle tasks? I'm thinking something like this:
```
tasks.register('checkstyle') {
description = 'Runs all checkstyle tasks'
group = 'verification'
dependsOn tasks.withType(Checkstyle)
}
```
Then we can run `./gradlew checkstyle` without having to list all targets
##########
.github/workflows/ci.yml:
##########
@@ -347,3 +390,178 @@ 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: 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: Build documentation
+ run: ./gradlew docs:asciidoctor
+
+ - name: Verify documentation
+ run: test -f docs/build/user.html && test -f
docs/build/development.html
Review Comment:
NIT for consistency with checks above:
```suggestion
run: |
test -f docs/build/user.html
test -f docs/build/development.html
```
##########
CHANGES.txt:
##########
@@ -1,5 +1,6 @@
0.3.0
-----
+ * Add Missing checks in GitHub actions vs Cicle CI (CASSSIDECAR-397)
Review Comment:
CI changes don't need to be mentioned in CHANGES.txt, we can remove this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]