mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
ci: add a problem matcher support, to get error/warning/notice annotations in V CI jobs (#22790)
This commit is contained in:
parent
f3b1674ed9
commit
0eaa85725b
5 changed files with 42 additions and 1 deletions
19
.github/problem-matchers/register_all.vsh
vendored
Normal file
19
.github/problem-matchers/register_all.vsh
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
// The task of this program, is to register all available .json files
|
||||||
|
// in this folder with Github Actions, so that it can make annotations
|
||||||
|
// for all found notices/warnings/errors produced by the V compiler
|
||||||
|
// while running the CI jobs.
|
||||||
|
// Those annotations provide a way to get a quick overview for failures,
|
||||||
|
// without having to scroll into the detailed logs produced by each job.
|
||||||
|
|
||||||
|
const github_job = getenv('GITHUB_JOB')
|
||||||
|
|
||||||
|
if github_job == '' {
|
||||||
|
exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
dump(github_job)
|
||||||
|
chdir(@VEXEROOT)!
|
||||||
|
for f in walk_ext('.github/problem-matchers/', '.json').sorted() {
|
||||||
|
println('::add-matcher::${real_path(f)}')
|
||||||
|
println('registered matcher: `${f}`')
|
||||||
|
}
|
18
.github/problem-matchers/v.json
vendored
Normal file
18
.github/problem-matchers/v.json
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"__comment": "Based on https://github.com/python/cpython/blob/main/.github/problem-matchers/gcc.json",
|
||||||
|
"problemMatcher": [
|
||||||
|
{
|
||||||
|
"owner": "v-problem-matcher",
|
||||||
|
"pattern": [
|
||||||
|
{
|
||||||
|
"regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error|notice):\\s+(.*)$",
|
||||||
|
"file": 1,
|
||||||
|
"line": 2,
|
||||||
|
"column": 3,
|
||||||
|
"severity": 4,
|
||||||
|
"message": 5
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -118,6 +118,7 @@ endif
|
||||||
@$(VEXE) run cmd/tools/detect_tcc.v
|
@$(VEXE) run cmd/tools/detect_tcc.v
|
||||||
@echo "V has been successfully built"
|
@echo "V has been successfully built"
|
||||||
@$(VEXE) -version
|
@$(VEXE) -version
|
||||||
|
@$(VEXE) run .github/problem-matchers/register_all.vsh
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(TMPTCC)
|
rm -rf $(TMPTCC)
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -15,8 +15,10 @@ v:
|
||||||
./v1 -no-parallel -o v2 $(VFLAGS) cmd/v
|
./v1 -no-parallel -o v2 $(VFLAGS) cmd/v
|
||||||
./v2 -o v $(VFLAGS) cmd/v
|
./v2 -o v $(VFLAGS) cmd/v
|
||||||
rm -rf v1 v2
|
rm -rf v1 v2
|
||||||
@echo "V has been successfully built"
|
|
||||||
./v run ./cmd/tools/detect_tcc.v
|
./v run ./cmd/tools/detect_tcc.v
|
||||||
|
@echo "V has been successfully built"
|
||||||
|
./v version
|
||||||
|
./v run .github/problem-matchers/register_all.vsh
|
||||||
|
|
||||||
check:
|
check:
|
||||||
./v test-all
|
./v test-all
|
||||||
|
|
1
make.bat
1
make.bat
|
@ -260,6 +260,7 @@ echo ^> To add V to your PATH, run `%V_EXE% symlink`.
|
||||||
echo.
|
echo.
|
||||||
echo | set /p="V version: "
|
echo | set /p="V version: "
|
||||||
"%V_EXE%" version
|
"%V_EXE%" version
|
||||||
|
"%V_EXE%" run .github/problem-matchers/register_all.vsh
|
||||||
goto :eof
|
goto :eof
|
||||||
|
|
||||||
:usage
|
:usage
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue