Skip to content

Upgrade dependencies #191

Upgrade dependencies

Upgrade dependencies #191

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
matrix-build:
runs-on: ubuntu-latest
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-java-${{ matrix.java }}
cancel-in-progress: true
strategy:
fail-fast: true
matrix:
java: [17, 21, 24]
name: "Build with Java ${{ matrix.java }}"
env:
DEFAULT_JAVA: 17
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: |
17
21
24
cache: 'maven'
- name: Cache SonarQube packages
uses: actions/cache@v5
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-java-${{ matrix.java }}-sonar
restore-keys: ${{ runner.os }}-java-${{ matrix.java }}-sonar
- name: Build with Maven
run: mvn --errors --batch-mode clean org.jacoco:jacoco-maven-plugin:prepare-agent install -DossindexSkip=true -Djava.version=${{ matrix.java }}
- name: Build example projects
run: |
cd src/test/resources/empty-project/
mvn --batch-mode verify
cd ../simple-project/
mvn --batch-mode verify
cd ../html-report/
mvn --batch-mode verify
cd ../project-with-tracing-defects
mvn --batch-mode verify
cd ../project-with-tracing-defects-fail-build/
mvn --batch-mode verify || true
- name: Sonar analysis
if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }}
run: |
mvn --errors --batch-mode \
-Dsonar.token=$SONAR_TOKEN \
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Verify reproducible build
run: |
mvn --batch-mode clean verify artifact:compare -DskipTests \
-DossindexSkip=true \
-Djava.version=${{ matrix.java }}
- name: Archive aggregated reproducible build report
uses: actions/upload-artifact@v7
with:
name: reproducible-build-report-java-${{ matrix.java }}
path: |
target/*.buildcompare
target/*.buildinfo
if-no-files-found: error
ossindex:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-java@v5
with:
cache: maven
distribution: temurin
java-version: 17
server-id: ossindex
server-username: OSSINDEX_USERNAME
server-password: OSSINDEX_TOKEN
- name: Ossindex
if: ${{ env.OSSINDEX_USERNAME != null && env.OSSINDEX_TOKEN != null }}
run: |
mvn --errors --batch-mode test-compile -Djava.version=17 \
org.sonatype.ossindex.maven:ossindex-maven-plugin:audit \
org.sonatype.ossindex.maven:ossindex-maven-plugin:audit-aggregate
env:
OSSINDEX_USERNAME: ${{ secrets.OSSINDEX_USERNAME }}
OSSINDEX_TOKEN: ${{ secrets.OSSINDEX_TOKEN }}
build:
permissions:
contents: read
needs:
- matrix-build
- ossindex
runs-on: ubuntu-slim
steps:
- run: echo "Build successful"