Skip to content

Upgrade dependencies #130

Upgrade dependencies

Upgrade dependencies #130

Workflow file for this run

name: Java CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
matrix-build:
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
matrix:
java: [11, 17, 21]
env:
DEFAULT_JAVA: 11
steps:
- uses: actions/checkout@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: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew build --warning-mode summary -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 }}
- name: Archive portmapper binary
uses: actions/upload-artifact@v4
if: ${{ env.DEFAULT_JAVA == matrix.java }}
with:
name: portmapper
path: build/libs/portmapper-*-all.jar
build:
needs: matrix-build
runs-on: ubuntu-latest
steps:
- run: echo "Build successful"