From ea7af2e4a25be844a711438452cb3695938dc97d Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 11 Mar 2021 15:07:27 +0000 Subject: [PATCH] Highlight error messages in CI Copied problem-matchers from github/semmle-code, which is used for running CI for github/codeql. --- .../problem-matchers/codeql-query-format.json | 14 ++++++++++++++ .../problem-matchers/codeql-syntax-check.json | 17 +++++++++++++++++ .github/problem-matchers/codeql-test-run.json | 14 ++++++++++++++ .github/problem-matchers/make.json | 13 +++++++++++++ .github/workflows/codeqltest.yml | 12 ++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 .github/problem-matchers/codeql-query-format.json create mode 100644 .github/problem-matchers/codeql-syntax-check.json create mode 100644 .github/problem-matchers/codeql-test-run.json create mode 100644 .github/problem-matchers/make.json diff --git a/.github/problem-matchers/codeql-query-format.json b/.github/problem-matchers/codeql-query-format.json new file mode 100644 index 00000000000..35f9c1a6f64 --- /dev/null +++ b/.github/problem-matchers/codeql-query-format.json @@ -0,0 +1,14 @@ +{ + "problemMatcher": [ + { + "owner": "codeql-query-format", + "pattern": [ + { + "regexp": "^((.*) would change by autoformatting\\.)$", + "file": 2, + "message": 1 + } + ] + } + ] +} diff --git a/.github/problem-matchers/codeql-syntax-check.json b/.github/problem-matchers/codeql-syntax-check.json new file mode 100644 index 00000000000..d285ffd77d8 --- /dev/null +++ b/.github/problem-matchers/codeql-syntax-check.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "codeql-syntax-check", + "pattern": [ + { + "regexp": "^((ERROR|WARNING): .* \\((.*):(\\d+),(\\d+)-\\d+\\))$", + "message": 1, + "file": 3, + "line": 4, + "col": 5, + "severity": 2 + } + ] + } + ] +} diff --git a/.github/problem-matchers/codeql-test-run.json b/.github/problem-matchers/codeql-test-run.json new file mode 100644 index 00000000000..918758b3390 --- /dev/null +++ b/.github/problem-matchers/codeql-test-run.json @@ -0,0 +1,14 @@ +{ + "problemMatcher": [ + { + "owner": "codeql-test-run", + "pattern": [ + { + "regexp": "(\\[.*\\] FAILED\\((RESULT|COMPILATION)\\) (.*))$", + "file": 3, + "message": 1 + } + ] + } + ] +} diff --git a/.github/problem-matchers/make.json b/.github/problem-matchers/make.json new file mode 100644 index 00000000000..8275f4851ab --- /dev/null +++ b/.github/problem-matchers/make.json @@ -0,0 +1,13 @@ +{ + "problemMatcher": [ + { + "owner": "make", + "pattern": [ + { + "regexp": "^(make: \\*\\*\\* .*)$", + "message": 1 + } + ] + } + ] +} diff --git a/.github/workflows/codeqltest.yml b/.github/workflows/codeqltest.yml index 75a43937dc8..f5b8aa55d36 100644 --- a/.github/workflows/codeqltest.yml +++ b/.github/workflows/codeqltest.yml @@ -30,6 +30,10 @@ jobs: - name: Check out code uses: actions/checkout@v2 + - name: Enable problem matchers in repository + shell: bash + run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' + - name: Build run: env PATH=$PATH:$HOME/codeql make @@ -75,6 +79,10 @@ jobs: - name: Check out code uses: actions/checkout@v2 + - name: Enable problem matchers in repository + shell: bash + run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' + - name: Build run: env PATH=$PATH:$HOME/codeql make @@ -108,6 +116,10 @@ jobs: - name: Check out code uses: actions/checkout@v2 + - name: Enable problem matchers in repository + shell: bash + run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;' + - name: Build run: | $Env:Path += ";$HOME\codeql"