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/**"