Skip to content

Java CI

Java CI #2600

Workflow file for this run

name: Java CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
name: Java ${{ matrix.java }}
strategy:
matrix:
java: [17,21]
steps:
- uses: actions/[email protected]
- name: Set up JDK ${{ matrix.java }}
if: ${{ matrix.java == 17 }}
uses: actions/[email protected]
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Set up GraalVM ${{ matrix.java }}
if: ${{ matrix.java == 21 }}
uses: graalvm/[email protected]
with:
java-version: '21'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Cache local Maven repository
uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: browser-actions/[email protected]
- uses: browser-actions/[email protected]
- name: Validate
run: ./mvnw -B clean validate
- name: Static Validation
run: ./mvnw -B -Pcheck-duplicate,check-checkstyle,check-cycles,check-cpd,check-pmd,check-spotbugs -DskipTests=true -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -DnvdApiKey=${{ secrets.NVDAPIKEY }} install
#run: ./mvnw -B -Pcheck-duplicate,check-checkstyle,check-cycles,check-cpd,check-pmd,check-spotbugs,check-dependency -DskipTests=true -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -DnvdApiKey=${{ secrets.NVDAPIKEY }} install
- name: Tests
run: ./mvnw -B -DwebDriverType=chrome verify
- name: Build Native Image
if: ${{ matrix.java == 21 }}
run: ./mvnw -B -Pnative spring-boot:build-image
- uses: codecov/[email protected]
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ matrix.java == 17 && github.event_name == 'push' && github.ref_name == '5.3.x' && github.repository_owner == 'joinfaces' }}
- name: Sonarqube
env:
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.java == 17 && github.event_name == 'push' && github.ref_name == '5.3.x' && github.repository_owner == 'joinfaces' }}
run: ./mvnw -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Pcheck-sonarqube sonar:sonar