From 08c96026aae944a06b04b42a9853526b7fcf0f41 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Sat, 4 Apr 2026 17:30:18 +0000 Subject: [PATCH] chore: merge CI + SonarCloud workflows, drop cross-platform job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Merge sonarcloud-java.yml into ci-java.yml — single build runs mvn verify then SonarCloud analysis (was running mvn verify twice) - Remove cross-platform job (Windows/macOS) — JVM is cross-platform, job had continue-on-error:true so never blocked anyway - SonarCloud only runs for same-repo PRs (skip forks without token) - Net: 2 fewer CI jobs per push/PR, ~50% faster CI Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci-java.yml | 30 +++++++++++-------------- .github/workflows/sonarcloud-java.yml | 32 --------------------------- 2 files changed, 13 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/sonarcloud-java.yml diff --git a/.github/workflows/ci-java.yml b/.github/workflows/ci-java.yml index 91670b1e..7521dab9 100644 --- a/.github/workflows/ci-java.yml +++ b/.github/workflows/ci-java.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: actions/setup-java@v4 with: distribution: 'temurin' @@ -26,20 +28,14 @@ jobs: with: name: coverage-report path: target/site/jacoco/ - - cross-platform: - needs: build - strategy: - fail-fast: false - matrix: - os: [windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '25' - cache: 'maven' - - run: mvn clean verify -B -pl . -Dfrontend.skip=true - continue-on-error: true + - name: SonarCloud analysis + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: > + mvn sonar:sonar -B + -Dsonar.projectKey=RandomCodeSpace_code-iq + -Dsonar.organization=randomcodespace + -Dsonar.host.url=https://sonarcloud.io + "-Dsonar.exclusions=**/grammar/**,target/generated-sources/**" + "-Dsonar.coverage.exclusions=**/grammar/**,target/generated-sources/**" diff --git a/.github/workflows/sonarcloud-java.yml b/.github/workflows/sonarcloud-java.yml deleted file mode 100644 index 9d95dd34..00000000 --- a/.github/workflows/sonarcloud-java.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: SonarCloud Java -on: - push: - branches: [main] - paths: ['src/**', 'pom.xml'] - pull_request: - branches: [main] - -jobs: - sonar: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '25' - cache: 'maven' - - name: Build and generate coverage - run: mvn clean verify -B - - name: SonarCloud analysis - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: > - mvn sonar:sonar -B - -Dsonar.projectKey=RandomCodeSpace_code-iq - -Dsonar.organization=randomcodespace - -Dsonar.host.url=https://sonarcloud.io - "-Dsonar.exclusions=**/grammar/**,target/generated-sources/**" - "-Dsonar.coverage.exclusions=**/grammar/**,target/generated-sources/**"