Skip to content

Commit

Permalink
sonar: split build and analyse into two jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
derTobsch committed Dec 5, 2024
1 parent bc63738 commit 03a06b2
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,41 @@ env:

jobs:
build:
name: build and analyse
name: Build
strategy:
matrix:
java: [ '11', '17', '21', '22', '23' ]
os: [ 'ubuntu-24.04', 'macos-14', 'windows-2022' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Build
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 ${{ matrix.java }}
- name: Set up JDK 11 and 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: |
11
${{ matrix.java }}
17
cache: 'maven'
- name: Build
run: ./mvnw -Pcoverage clean verify

- name: SonarQube Cloud - Analyse
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]')) }}
- name: SonarQube Cloud Analysis
run: >
./mvnw -Pcoverage verify
sonar:sonar
Expand Down

0 comments on commit 03a06b2

Please sign in to comment.