Bump github/codeql-action from 3 to 4 (#59) #144
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Java CI with Gradle | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| matrix-build: | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: "bash" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java: [17, 21] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-java-${{ matrix.java }} | |
| cancel-in-progress: true | |
| name: "Build with Java ${{ matrix.java }}" | |
| env: | |
| DEFAULT_JAVA: 17 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Cache SonarQube packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-java-${{ matrix.java }}-sonar | |
| restore-keys: ${{ runner.os }}-java-${{ matrix.java }}-sonar | |
| - name: Build with Java ${{ matrix.java }} | |
| run: ./gradlew build --info --warning-mode all -PjavaVersion=${{ matrix.java }} | |
| env: | |
| ORG_GRADLE_PROJECT_ossIndexUsername: ${{ secrets.OSSINDEX_USERNAME }} | |
| ORG_GRADLE_PROJECT_ossIndexToken: ${{ secrets.OSSINDEX_TOKEN }} | |
| - name: Sonar analysis | |
| if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }} | |
| run: ./gradlew sonar --warning-mode all -Dsonar.token=$SONAR_TOKEN | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| build: | |
| needs: matrix-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "Build successful" |