Merge pull request #272 from XSpielinbox/main #1191
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: | |
schedule: | |
- cron: "15 0 * * *" | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: build and analyse | |
strategy: | |
matrix: | |
java: [ '11', '17', '19' ] | |
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] | |
runs-on: ${{ matrix.os }} | |
env: | |
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
cache: 'maven' | |
- name: Build | |
run: > | |
./mvnw $MAVEN_CLI_OPTS | |
-Pcoverage | |
clean verify | |
- name: Analyse with SonarCloud | |
if: ${{ matrix.java == 17 && matrix.os == 'ubuntu-latest' && (github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) }} | |
run: > | |
./mvnw $MAVEN_CLI_OPTS | |
-Pcoverage | |
verify | |
sonar:sonar | |
-Dsonar.host.url=https://sonarcloud.io | |
-Dsonar.organization=focus-shift | |
-Dsonar.projectKey=focus-shift_jollyday | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |