Skip to content

Feature/#178 heimat integration #481

Feature/#178 heimat integration

Feature/#178 heimat integration #481

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
schedule:
- cron: "0 8 * * 1" #Runs pipeline once a week https://jasonet.co/posts/scheduled-actions/
jobs:
build-analyze:
runs-on: ubuntu-latest
env:
version: 2.0.${{ github.run_number }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'java'
- name: Build
run: mvn -V -B clean package org.jacoco:jacoco-maven-plugin:0.8.7:prepare-agent org.jacoco:jacoco-maven-plugin:0.8.7:report -Pcoverage -Dproject.version=${{ env.version }}-SNAPSHOT
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: KeepTime-${{ env.version }}
path: /home/runner/work/KeepTime/KeepTime/target/*-bin.zip
- name: Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -V -B sonar:sonar -Dsonar.host.url=${{ secrets.HOST_URL }} -Dsonar.organization=${{ secrets.ORGANIZATION_NAME }} -Dsonar.projectKey=${{ secrets.PROJECT_KEY }} -Dsonar.java.binaries=. -Dsonar.qualitygate.wait=false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
dependency-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Build
run: mvn -V -B clean package
- name: Depcheck
uses: dependency-check/Dependency-Check_Action@main
id: Depcheck
env:
# actions/setup-java@v1 changes JAVA_HOME so it needs to be reset to match the depcheck image
JAVA_HOME: /opt/jdk
with:
project: 'KeepTime'
path: '.'
format: 'HTML'
out: 'reports' # this is the default, no need to specify unless you wish to override it
args: >
--failOnCVSS 8.9
--enableRetired
- name: Upload Test results
if: always()
uses: actions/upload-artifact@v4
with:
name: Depcheck report
path: ${{github.workspace}}/reports