File tree 2 files changed +22
-2
lines changed
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 83
83
# Try building the application (+e as we want to test every example and get a
84
84
# summary on what is working)
85
85
set +e
86
- pio --no-ansi run -d " $PROJECTDIR " -e " $BOARD " 2>&1 | " $CIDIR /scripts/pio-to-gh-log.py"
86
+ pio --no-ansi run -d " $PROJECTDIR " -e " $BOARD " 2>&1 | \
87
+ " $CIDIR /scripts/pio-to-gh-log.py" \
88
+ " src/main.cpp:examples/$EXAMPLENAME /$EXAMPLENAME .ino:-1" \
89
+ " lib/esp32_https_server/:src/" \
90
+ " $REPODIR /:"
87
91
RC=${PIPESTATUS[0]}
88
92
if [[ " $RC " != " 0" ]]; then
89
93
echo " ::error::pio returned with RC=$RC "
Original file line number Diff line number Diff line change 7
7
8
8
re_err = re .compile (r"^([^:]+):([0-9]+):([0-9]+): error: (.*)$" )
9
9
10
+ # Parameters are strings of the form
11
+ # path_prefix:replacement_prefix:line_offset
12
+ # Where all paths starting with path_prefix will be replced with replacement_prefix,
13
+ # and if such a replacement takes place, the line number will be shifted by line_offset.
14
+ # That allows taking care for inserted code like the #include <Arduino.h>
15
+ mappings = []
16
+ for arg in sys .argv [1 :]:
17
+ parts = arg .split (":" , 2 )
18
+ mappings .append ((* parts [0 :2 ], 0 if len (parts )== 2 else int (parts [2 ])))
19
+
10
20
for line in sys .stdin :
11
21
print (line , end = "" )
12
22
m = re_err .match (line .strip ())
13
23
if m is not None :
24
+ name = m .group (1 )
25
+ lineno = int (m .group (2 ))
26
+ for mapping in mappings :
27
+ if name .startswith (mapping [0 ]):
28
+ name = mapping [1 ] + name [len (mapping [0 ]):]
29
+ lineno += mapping [2 ]
14
30
print ("::error file={name},line={line},col={col}::{message}" .format (
15
- name = m . group ( 1 ) , line = m . group ( 2 ) , col = m .group (3 ), message = m .group (4 )
31
+ name = name , line = lineno , col = m .group (3 ), message = m .group (4 )
16
32
))
You can’t perform that action at this time.
0 commit comments