Skip to content

Commit 1031f23

Browse files
authored
[workflow] Use MSVC problem matcher for Windows action build (GH-18532)
This makes warnings and errors from the compiler very prominent so this should help prevent warnings from sneaking into the code base and catch them in review. See https://discuss.python.org/t/using-github-problem-matchers-to-catch-warnings-early/4254 for more details You can see a demo of this in action here: https://github.com/ammaraskar/cpython/pull/15/files#diff-9ba2eeca0f254ece0a9df4d7cb68e870 GCC and Sphinx matchers have previously been added in GH-18567 and GH-20325, respectively.
1 parent bf108bb commit 1031f23

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/problem-matchers/msvc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"__comment": "Taken from vscode's vs/workbench/contrib/tasks/common/problemMatcher.ts msCompile rule",
3+
"problemMatcher": [
4+
{
5+
"owner": "msvc-problem-matcher",
6+
"pattern": [
7+
{
8+
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
9+
"file": 1,
10+
"line": 2,
11+
"column": 3,
12+
"severity": 4,
13+
"code": 5,
14+
"message": 6
15+
}
16+
]
17+
}
18+
]
19+
}

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ jobs:
9999
if: needs.check_source.outputs.run_tests == 'true'
100100
steps:
101101
- uses: actions/checkout@v2
102+
- name: Register MSVC problem matcher
103+
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
102104
- name: Build CPython
103105
run: .\PCbuild\build.bat -e -p x64
104106
- name: Display build info

0 commit comments

Comments
 (0)