Upgrade dependencies (#65) #146
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 | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [11, 17, 21, 23] | |
env: | |
DEFAULT_JAVA: 11 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Java ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- 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 Gradle | |
run: ./gradlew clean build --info --warning-mode all -PjavaVersion=${{ matrix.java }} | |
- name: Sonar analysis | |
if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }} | |
run: ./gradlew sonarqube -Dsonar.token=$SONAR_TOKEN --info --warning-mode=summary | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |