Skip to content

Commit

Permalink
sonar: splut build and analyse into two jobs
Browse files Browse the repository at this point in the history
closes #11
  • Loading branch information
derTobsch committed Dec 5, 2024
1 parent 3734774 commit 1c951f3
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:

jobs:
build:
name: build and analyse
name: Build
strategy:
matrix:
java: [ '11', '17', '21', '22', '23' ]
Expand All @@ -23,21 +23,35 @@ 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:
distribution: 'temurin'
java-version: |
11
${{ matrix.java }}
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Build
run: ./mvnw -Pcoverage clean verify

- name: SonarQube Cloud - Analyse
run: ./mvnw verify
- name: Trigger SonarQube Cloud Analysis
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: echo "run-sonarqube-analysis=true" >> $GITHUB_OUTPUT

sonarqube:
name: SonarQube Cloud
needs: build
if: ${{ needs.build.outputs.run-sonarqube-analysis == 'true' }}
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
cache: 'maven'
- name: SonarQube Cloud Analysis
run: >
./mvnw -Pcoverage verify
sonar:sonar
Expand Down

0 comments on commit 1c951f3

Please sign in to comment.