Bump org.kiwiproject:kiwi-bom from 2.0.0 to 2.0.1 #878
Workflow file for this run
This file contains 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: build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
paths-ignore: | |
- '**/*.md' | |
- '**/*.txt' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
java_version: ['17', '20'] | |
steps: | |
# Check out the project | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
# Setup the version of Java | |
- name: Set up JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java_version }} | |
distribution: 'temurin' | |
check-latest: true | |
# Cache all the things | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '17' }} | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Cache Embedded Mongo files | |
uses: actions/cache@v3 | |
with: | |
path: ~/.embedmongo | |
key: ${{ runner.os }}-embedmongo | |
restore-keys: ${{ runner.os }}-embedmongo | |
# Compile the project | |
- name: Build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
run: mvn -B -V compile | |
# Run tests when Java version > 17 (Sonar runs tests and analysis on JDK 17) | |
- name: Run tests | |
if: ${{ matrix.java_version != '17' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
run: mvn -B -V verify | |
# Run Sonar Analysis (on Java version 17 only) | |
- name: Analyze with SonarCloud | |
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '17' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: mvn -B -V -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml org.jacoco:jacoco-maven-plugin:prepare-agent verify org.jacoco:jacoco-maven-plugin:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar |