From c62af83627d75c99ae5d6938fb59ac71f270ed29 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 25 Nov 2024 09:24:47 +0100 Subject: [PATCH] Add a problem matcher for gcc warnings/errors: for develop commits, and branch of PR Pwned from https://github.com/microsoft/vscode-cpptools/blob/bfa3c7544ef63e7e0b6d0bd6bf8a1363ed3c4deb/Extension/package.json#L439 --- .github/workflows/cpp-problem-matcher.json | 17 +++++++++++++++++ .github/workflows/test_develop_commits.yml | 5 ++++- .github/workflows/test_pull_requests.yml | 5 ++++- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/cpp-problem-matcher.json diff --git a/.github/workflows/cpp-problem-matcher.json b/.github/workflows/cpp-problem-matcher.json new file mode 100644 index 00000000000..e7932b4950b --- /dev/null +++ b/.github/workflows/cpp-problem-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "gcc-problem-matcher", + "pattern": [ + { + "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + ] + } + ] +} diff --git a/.github/workflows/test_develop_commits.yml b/.github/workflows/test_develop_commits.yml index 0c1b2fbcb9a..389285ae581 100644 --- a/.github/workflows/test_develop_commits.yml +++ b/.github/workflows/test_develop_commits.yml @@ -135,7 +135,10 @@ jobs: - name: Build id: build working-directory: ./build - run: cmake --build . -j ${{ matrix.nproc }} --config Release + run: | + echo "::add-matcher::.github/workflows/cpp-problem-matcher.json" + cmake --build . -j ${{ matrix.nproc }} --config Release + echo "::remove-matcher owner=gcc-problem-matcher::" - name: Test # Not running test on alternate build yet, I need to test things diff --git a/.github/workflows/test_pull_requests.yml b/.github/workflows/test_pull_requests.yml index dbfa4ea0856..4c6f2eec7c1 100644 --- a/.github/workflows/test_pull_requests.yml +++ b/.github/workflows/test_pull_requests.yml @@ -155,7 +155,10 @@ jobs: - name: Branch Build id: branch_build working-directory: ./branch/build - run: cmake --build . -j ${{ matrix.nproc }} --config Release + run: | + echo "::add-matcher::.github/workflows/cpp-problem-matcher.json" + cmake --build . -j ${{ matrix.nproc }} --config Release + echo "::remove-matcher owner=gcc-problem-matcher::" - name: Branch Test working-directory: ./branch/build