Skip to content

Upgrade dependencies #128

Upgrade dependencies

Upgrade dependencies #128

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: 21
steps:
- uses: actions/checkout@v4
- name: Cache Gradle packages and wrapper
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-java-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-java-${{ matrix.java }}-gradle
- 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 }}
- uses: gradle/actions/wrapper-validation@v3
- 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"