Skip to content

Spring 3 + Mac

Spring 3 + Mac #433

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:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: dependencyCheck
run: mvn dependency-check:check