Skip to content

Commit 5e170bc

Browse files
committed
CI: Restore sketch build flags
1 parent 323a247 commit 5e170bc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/scripts/install-platformio.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ function build_pio_sketch(){ # build_pio_sketch <board> <options> <path-to-ino>
1818
local board="$1"
1919
local options="$2"
2020
local sketch="$3"
21+
local buildFlags="$4"
2122
local sketch_dir=$(dirname "$sketch")
2223
echo ""
2324
echo "Compiling '"$(basename "$sketch")"' ..."
24-
python -m platformio ci --board "$board" "$sketch_dir" --project-option="$options" --project-option="framework=arduino"
25+
python -m platformio ci -l "." --board "$board" "$sketch_dir" --project-option="$options" --project-option="build_flags=$buildFlags"
2526
}
2627

2728
function count_sketches(){ # count_sketches <examples-path>
@@ -116,12 +117,18 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
116117
|| [ -f "$sketchdir/.test.skip" ]; then
117118
continue
118119
fi
120+
local sketchBuildFlags=""
121+
if [ -f "$sketchdir/.test.build_flags" ]; then
122+
while read line; do
123+
sketchBuildFlags="$sketchBuildFlags $line"
124+
done < "$sketchdir/.test.build_flags"
125+
fi
119126
sketchnum=$(($sketchnum + 1))
120127
if [ "$sketchnum" -le "$start_index" ] \
121128
|| [ "$sketchnum" -gt "$end_index" ]; then
122129
continue
123130
fi
124-
build_pio_sketch "$board" "$options" "$sketch"
131+
build_pio_sketch "$board" "$options" "$sketch" "$sketchBuildFlags"
125132
local result=$?
126133
if [ $result -ne 0 ]; then
127134
return $result

0 commit comments

Comments
 (0)