GHA CI build workflow improvements (#12425)

* Add error annotations only in Java 11 matrix build to prevent duplicates
* Make sure Java 11 build is not cancelled when Java 17 build fails so it can add annotations by using `fail-fast: false`
* Use changed files only for incremental PR builds so a full build is done for changes merged into 'main' branch
* Add GHA build status badge

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2022-03-06 19:42:48 +01:00
committed by GitHub
parent 4d01af7165
commit 5842ad1644
2 changed files with 6 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
java: [ '11', '17' ]
maven: [ '3.8.4']
@@ -55,11 +56,13 @@ jobs:
maven-version: ${{ matrix.maven }}
- name: Register Problem Matchers
if: ${{ matrix.java == '11' }}
id: problem_matchers
run: |
echo "::add-matcher::.github/openhab-compile-problems.json"
- name: Get Changed Files
if: github.head_ref != ''
id: files
uses: Ana06/get-changed-files@v2.0.0
with:
@@ -91,8 +94,8 @@ jobs:
path: target/summary_report.html
- name: Report SAT Errors as Annotations
if: ${{ matrix.java == '11' && always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
uses: ghys/checkstyle-github-action@main
if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
with:
title: CheckStyle Violations
path: '**/checkstyle-result.xml'