]> git.basschouten.com Git - openhab-addons.git/commitdiff
Report SAT Errors with GHA Annotations (#11652)
authorWouter Born <github@maindrain.net>
Sun, 28 Nov 2021 18:31:53 +0000 (19:31 +0100)
committerGitHub <noreply@github.com>
Sun, 28 Nov 2021 18:31:53 +0000 (19:31 +0100)
Let's test the GHA annotations for errors also in this repo!

Similar to openhab/openhab-core#2543

Signed-off-by: Wouter Born <github@maindrain.net>
.github/openhab-compile-problems.json [new file with mode: 0644]
.github/workflows/ci-build.yml

diff --git a/.github/openhab-compile-problems.json b/.github/openhab-compile-problems.json
new file mode 100644 (file)
index 0000000..a5c5c4b
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "problemMatcher": [
+    {
+      "owner": "openhab-compile-problems",
+      "severity": "error",
+      "pattern": [
+        {
+          "regexp": "Failed to execute goal.*Compilation failure"
+        },
+        {
+          "regexp": "^\\[ERROR\\] (.+\\.java):\\[(.+),(.+)\\] (.*)$",
+          "file": 1,
+          "line": 2,
+          "col": 3,
+          "message": 4,
+          "loop": true
+        }
+      ]
+    }
+  ]
+}
index ae6fc2af989fac1ccb2f6343b97810b5209082fc..fc5c2a2cf96be339b593bb47eb578e22ec3e8c6f 100644 (file)
@@ -54,6 +54,11 @@ jobs:
         with:
           maven-version: ${{ matrix.maven }}
 
+      - name: Register Problem Matchers
+        id: problem_matchers
+        run: |
+          echo "::add-matcher::.github/openhab-compile-problems.json"
+
       - name: Get Changed Files
         id: files
         uses: Ana06/get-changed-files@v2.0.0
@@ -84,3 +89,11 @@ jobs:
         with:
           name: sat-summary-report
           path: target/summary_report.html
+
+      - name: Report SAT Errors as Annotations
+        uses: ghys/checkstyle-github-action@main
+        if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
+        with:
+          title: CheckStyle Violations
+          path: '**/checkstyle-result.xml'
+          mode: inline