Skip to content

maven-main-build

maven-main-build #4

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: maven-main-build
concurrency: build
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 5 15 * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@9ff9d14760a73102d9fa2f47131624137f50ead8
with:
egress-policy: audit #outbound hosts constantly subject to change by action providers
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
fetch-depth: '0'
ref: master
- name: Set up JDK 17
uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
with:
java-version: 17
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache SonarCloud packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build and analyze main
run: |
export OSM_IMPORT_FILE=https://github.com/datengaertnerei/test-data-service/raw/develop/data/osm-small.pbf
chmod u+x ./mvnw
./mvnw -B clean package org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- uses: codecov/codecov-action@fd624e50e79ee493cc04fa548dbb550c038281da