diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dde3a0ff6..7bc474a7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ env: jobs: build: - name: build and analyse + name: Build strategy: matrix: java: [ '11', '17', '21', '22', '23' ] @@ -23,8 +23,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v4 with: @@ -32,15 +30,32 @@ jobs: java-version: ${{ matrix.java }} cache: 'maven' - name: Build - run: ./mvnw -Pcoverage clean verify - - name: Analyse with SonarCloud - if: ${{ github.repository == 'focus-shift/jollyday' && matrix.java == 21 && matrix.os == 'ubuntu-24.04' && (github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) }} + run: ./mvnw verify + + sonarqube: + name: SonarQube Cloud + runs-on: ubuntu-24.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up JDK 11 and 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: | + 11 + 17 + cache: 'maven' + - name: SonarQube Cloud Analysis run: > ./mvnw -Pcoverage verify sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=focus-shift -Dsonar.projectKey=focus-shift_jollyday + -Dsonar.java.jdkHome=${{ env.JAVA_HOME_11_X64 }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}