Browse Source

CI: Add explicit problem matchers

Thaddeus Crews 8 months ago
parent
commit
357679ceb8

+ 4 - 0
.github/actions/godot-deps/action.yml

@@ -29,3 +29,7 @@ runs:
         python -c "import sys; print(sys.version)"
         python -c "import sys; print(sys.version)"
         python -m pip install scons==${{ inputs.scons-version }}
         python -m pip install scons==${{ inputs.scons-version }}
         scons --version
         scons --version
+
+    - name: Setup problem matchers
+      shell: bash
+      run: echo ::add-matcher::misc/utility/problem-matchers.json

+ 3 - 4
.github/workflows/godot_cpp_test.yml

@@ -21,7 +21,9 @@ jobs:
       - name: Checkout
       - name: Checkout
         uses: actions/checkout@v4
         uses: actions/checkout@v4
         with:
         with:
-          sparse-checkout: .github
+          sparse-checkout: |
+            .github
+            misc/utility/problem-matchers.json
 
 
       - name: Checkout godot-cpp
       - name: Checkout godot-cpp
         uses: actions/checkout@v4
         uses: actions/checkout@v4
@@ -34,9 +36,6 @@ jobs:
       - name: Setup Python and SCons
       - name: Setup Python and SCons
         uses: ./.github/actions/godot-deps
         uses: ./.github/actions/godot-deps
 
 
-      - name: Setup GCC problem matcher
-        uses: ammaraskar/gcc-problem-matcher@master
-
       - name: Download GDExtension interface and API dump
       - name: Download GDExtension interface and API dump
         uses: ./.github/actions/download-artifact
         uses: ./.github/actions/download-artifact
         with:
         with:

+ 3 - 3
.github/workflows/linux_builds.yml

@@ -133,9 +133,6 @@ jobs:
           python-version: 3.8
           python-version: 3.8
           scons-version: 4.0
           scons-version: 4.0
 
 
-      - name: Setup GCC problem matcher
-        uses: ammaraskar/gcc-problem-matcher@master
-
       - name: Compilation
       - name: Compilation
         uses: ./.github/actions/godot-build
         uses: ./.github/actions/godot-build
         with:
         with:
@@ -158,6 +155,9 @@ jobs:
       - name: Build .NET solutions
       - name: Build .NET solutions
         if: matrix.build-mono
         if: matrix.build-mono
         run: |
         run: |
+          # FIXME: C# warnings should be properly handled eventually, but we don't want to clutter
+          # the GitHub Actions annotations, so remove the associated problem matcher for now.
+          echo "::remove-matcher owner=msvc::"
           ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
           ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
 
 
       - name: Prepare artifact
       - name: Prepare artifact

+ 0 - 8
.github/workflows/windows_builds.yml

@@ -86,14 +86,6 @@ jobs:
       - name: Extract pre-built ANGLE static libraries
       - name: Extract pre-built ANGLE static libraries
         run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/
         run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/
 
 
-      - name: Setup MSVC problem matcher
-        if: matrix.compiler == 'msvc'
-        uses: ammaraskar/msvc-problem-matcher@master
-
-      - name: Setup GCC problem matcher
-        if: matrix.compiler != 'msvc'
-        uses: ammaraskar/gcc-problem-matcher@master
-
       - name: Compilation
       - name: Compilation
         uses: ./.github/actions/godot-build
         uses: ./.github/actions/godot-build
         with:
         with:

+ 32 - 0
misc/utility/problem-matchers.json

@@ -0,0 +1,32 @@
+{
+	"problemMatcher": [
+		{
+			"owner": "gcc",
+			"pattern": [
+				{
+					"regexp": "^(?:\\s+\\d+\\>)?(\\S.*?)[\\(:](\\d+)[,:]?(\\d*)(?::{\\d+:\\d+\\-\\d+:\\d+})?\\)?:\\s+(?:fatal\\s+)?(error|warning|info):\\s+(.*?)(?:\\s*\\[(.*)\\])?$",
+					"file": 1,
+					"line": 2,
+					"column": 3,
+					"severity": 4,
+					"message": 5,
+					"code": 6
+				}
+			]
+		},
+		{
+			"owner": "msvc",
+			"pattern": [
+				{
+					"regexp": "^(?:\\s+\\d+\\>)?(\\S.*)\\((\\d+),?(\\d*)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(?:fatal\\s+)?(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
+					"file": 1,
+					"line": 2,
+					"column": 3,
+					"severity": 4,
+					"code": 5,
+					"message": 6
+				}
+			]
+		}
+	]
+}