Skip to content

Commit ebe34f6

Browse files
authored
Merge branch 'master' into release/v3.0.x
2 parents 5042912 + 4285912 commit ebe34f6

27 files changed

+298
-134
lines changed

Diff for: .editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ indent_size = 2
1818
indent_style = space
1919

2020
[*.{bash,sh}]
21-
indent_size = 2
21+
indent_size = 4
2222
indent_style = space
2323

2424
[*.{c,cc,cp,cpp,cxx,h,hh,hpp,hxx,ii,inl,ino,ixx,pde,tpl,tpp,txx}]

Diff for: .github/ISSUE_TEMPLATE/Issue-report.yml

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v3.0.6
45+
- v3.0.5
4446
- v3.0.4
4547
- v3.0.3
4648
- v3.0.2

Diff for: .github/scripts/find_new_boards.sh

+16-38
Original file line numberDiff line numberDiff line change
@@ -8,53 +8,32 @@ url="https://api.github.com/repos/$owner_repository/pulls/$pr_number/files"
88
echo $url
99

1010
# Get changes in boards.txt file from PR
11-
Patch=$(curl $url | jq -r '.[] | select(.filename == "boards.txt") | .patch ')
11+
Boards_modified_url=$(curl -s $url | jq -r '.[] | select(.filename == "boards.txt") | .raw_url')
1212

13-
# Extract only changed lines number and count
14-
substring_patch=$(echo "$Patch" | grep -o '@@[^@]*@@')
13+
# Echo the modified boards.txt file URL
14+
echo "Modified boards.txt file URL:"
15+
echo $Boards_modified_url
1516

16-
params_array=()
17+
# Download the modified boards.txt file
18+
curl -L -o boards_pr.txt $Boards_modified_url
1719

18-
IFS=$'\n' read -d '' -ra params <<< $(echo "$substring_patch" | grep -oE '[-+][0-9]+,[0-9]+')
20+
# Compare boards.txt file in the repo with the modified file
21+
diff=$(diff -u boards.txt boards_pr.txt)
1922

20-
for param in "${params[@]}"
21-
do
22-
echo "The parameter is $param"
23-
params_array+=("$param")
24-
done
23+
# Extract added or modified lines (lines starting with '+' or '-')
24+
modified_lines=$(echo "$diff" | grep -E '^[+-][^+-]')
2525

2626
boards_array=()
2727
previous_board=""
2828
file="boards.txt"
2929

30-
# Loop through boards.txt file and extract all boards that were added
31-
for (( c=0; c<${#params_array[@]}; c+=2 ))
30+
# Extract board names from the modified lines, and add them to the boards_array
31+
while read -r line
3232
do
33-
deletion_count=$( echo "${params_array[c]}" | cut -d',' -f2 | cut -d' ' -f1 )
34-
addition_line=$( echo "${params_array[c+1]}" | cut -d'+' -f2 | cut -d',' -f1 )
35-
addition_count=$( echo "${params_array[c+1]}" | cut -d'+' -f2 | cut -d',' -f2 | cut -d' ' -f1 )
36-
addition_end=$(($addition_line+$addition_count))
37-
38-
addition_line=$(($addition_line + 3))
39-
addition_end=$(($addition_end - $deletion_count))
40-
41-
echo $addition_line
42-
echo $addition_end
43-
44-
i=0
45-
46-
while read -r line
47-
do
48-
i=$((i+1))
49-
if [ $i -lt $addition_line ]
50-
then
51-
continue
52-
elif [ $i -gt $addition_end ]
53-
then
54-
break
55-
fi
5633
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
57-
if [ "$board_name" != "" ] && [ "$board_name" != "esp32_family" ]
34+
# remove + or - from the board name at the beginning
35+
board_name=$(echo "$board_name" | sed 's/^[+-]//')
36+
if [ "$board_name" != "" ] && [ "$board_name" != "+" ] && [ "$board_name" != "-" ] && [ "$board_name" != "esp32_family" ]
5837
then
5938
if [ "$board_name" != "$previous_board" ]
6039
then
@@ -63,8 +42,7 @@ do
6342
echo "Added 'espressif:esp32:$board_name' to array"
6443
fi
6544
fi
66-
done < "$file"
67-
done
45+
done <<< "$modified_lines"
6846

6947
# Create JSON like string with all boards found and pass it to env variable
7048
board_count=${#boards_array[@]}

Diff for: .github/scripts/install-platformio-esp32.sh

+38-4
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ function count_sketches(){ # count_sketches <examples-path>
9696
continue
9797
fi
9898

99-
# Check if the sketch requires any configuration options
99+
# Check if the sketch requires any configuration options (AND)
100100
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
101-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
101+
if [[ "$requirements" != "null" && "$requirements" != "" ]]; then
102102
for requirement in $requirements; do
103103
requirement=$(echo $requirement | xargs)
104104
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
@@ -107,6 +107,23 @@ function count_sketches(){ # count_sketches <examples-path>
107107
fi
108108
done
109109
fi
110+
111+
# Check if the sketch requires any configuration options (OR)
112+
requirements_or=$(jq -r '.requires_any[]? // empty' $sketchdir/ci.json)
113+
if [[ "$requirements_or" != "null" && "$requirements_or" != "" ]]; then
114+
found=false
115+
for requirement in $requirements_or; do
116+
requirement=$(echo $requirement | xargs)
117+
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
118+
if [[ "$found_line" != "" ]]; then
119+
found=true
120+
break
121+
fi
122+
done
123+
if [[ "$found" == "false" ]]; then
124+
continue
125+
fi
126+
fi
110127
fi
111128

112129
echo $sketch >> sketches.txt
@@ -187,9 +204,9 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
187204
continue
188205
fi
189206

190-
# Check if the sketch requires any configuration options
207+
# Check if the sketch requires any configuration options (AND)
191208
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
192-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
209+
if [[ "$requirements" != "null" && "$requirements" != "" ]]; then
193210
for requirement in $requirements; do
194211
requirement=$(echo $requirement | xargs)
195212
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
@@ -198,6 +215,23 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
198215
fi
199216
done
200217
fi
218+
219+
# Check if the sketch requires any configuration options (OR)
220+
requirements_or=$(jq -r '.requires_any[]? // empty' $sketchdir/ci.json)
221+
if [[ "$requirements_or" != "null" && "$requirements_or" != "" ]]; then
222+
found=false
223+
for requirement in $requirements_or; do
224+
requirement=$(echo $requirement | xargs)
225+
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
226+
if [[ "$found_line" != "" ]]; then
227+
found=true
228+
break
229+
fi
230+
done
231+
if [[ "$found" == "false" ]]; then
232+
continue
233+
fi
234+
fi
201235
fi
202236

203237
sketchnum=$(($sketchnum + 1))

Diff for: .github/scripts/sketch_utils.sh

+61-18
Original file line numberDiff line numberDiff line change
@@ -98,34 +98,42 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
9898

9999
# Default FQBN options if none were passed in the command line.
100100

101-
esp32_opts="PSRAM=enabled,FlashMode=dio${fqbn_append:+,$fqbn_append}"
102-
esp32s2_opts="PSRAM=enabled,FlashMode=dio${fqbn_append:+,$fqbn_append}"
103-
esp32s3_opts="PSRAM=opi,USBMode=default,FlashMode=dio${fqbn_append:+,$fqbn_append}"
104-
esp32c3_opts="FlashMode=dio${fqbn_append:+,$fqbn_append}"
105-
esp32c6_opts="FlashMode=dio${fqbn_append:+,$fqbn_append}"
106-
esp32h2_opts="FlashMode=dio${fqbn_append:+,$fqbn_append}"
101+
esp32_opts="PSRAM=enabled${fqbn_append:+,$fqbn_append}"
102+
esp32s2_opts="PSRAM=enabled${fqbn_append:+,$fqbn_append}"
103+
esp32s3_opts="PSRAM=opi,USBMode=default${fqbn_append:+,$fqbn_append}"
104+
esp32c3_opts="$fqbn_append"
105+
esp32c6_opts="$fqbn_append"
106+
esp32h2_opts="$fqbn_append"
107107

108108
# Select the common part of the FQBN based on the target. The rest will be
109109
# appended depending on the passed options.
110110

111+
opt=""
112+
111113
case "$target" in
112114
"esp32")
113-
fqbn="espressif:esp32:esp32:${options:-$esp32_opts}"
115+
[ -n "${options:-$esp32_opts}" ] && opt=":${options:-$esp32_opts}"
116+
fqbn="espressif:esp32:esp32$opt"
114117
;;
115118
"esp32s2")
116-
fqbn="espressif:esp32:esp32s2:${options:-$esp32s2_opts}"
119+
[ -n "${options:-$esp32s2_opts}" ] && opt=":${options:-$esp32s2_opts}"
120+
fqbn="espressif:esp32:esp32s2$opt"
117121
;;
118122
"esp32c3")
119-
fqbn="espressif:esp32:esp32c3:${options:-$esp32c3_opts}"
123+
[ -n "${options:-$esp32c3_opts}" ] && opt=":${options:-$esp32c3_opts}"
124+
fqbn="espressif:esp32:esp32c3$opt"
120125
;;
121126
"esp32s3")
122-
fqbn="espressif:esp32:esp32s3:${options:-$esp32s3_opts}"
127+
[ -n "${options:-$esp32s3_opts}" ] && opt=":${options:-$esp32s3_opts}"
128+
fqbn="espressif:esp32:esp32s3$opt"
123129
;;
124130
"esp32c6")
125-
fqbn="espressif:esp32:esp32c6:${options:-$esp32c6_opts}"
131+
[ -n "${options:-$esp32c6_opts}" ] && opt=":${options:-$esp32c6_opts}"
132+
fqbn="espressif:esp32:esp32c6$opt"
126133
;;
127134
"esp32h2")
128-
fqbn="espressif:esp32:esp32h2:${options:-$esp32h2_opts}"
135+
[ -n "${options:-$esp32h2_opts}" ] && opt=":${options:-$esp32h2_opts}"
136+
fqbn="espressif:esp32:esp32h2$opt"
129137
;;
130138
esac
131139

@@ -163,9 +171,9 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
163171
exit 0
164172
fi
165173

166-
# Check if the sketch requires any configuration options
174+
# Check if the sketch requires any configuration options (AND)
167175
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
168-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
176+
if [[ "$requirements" != "null" && "$requirements" != "" ]]; then
169177
for requirement in $requirements; do
170178
requirement=$(echo $requirement | xargs)
171179
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/$target/sdkconfig")
@@ -175,6 +183,24 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
175183
fi
176184
done
177185
fi
186+
187+
# Check if the sketch excludes any configuration options (OR)
188+
requirements_or=$(jq -r '.requires_any[]? // empty' $sketchdir/ci.json)
189+
if [[ "$requirements_or" != "null" && "$requirements_or" != "" ]]; then
190+
found=false
191+
for requirement in $requirements_or; do
192+
requirement=$(echo $requirement | xargs)
193+
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/$target/sdkconfig")
194+
if [[ "$found_line" != "" ]]; then
195+
found=true
196+
break
197+
fi
198+
done
199+
if [[ "$found" == "false" ]]; then
200+
echo "Target $target meets none of the requirements in requires_any for $sketchname. Skipping."
201+
exit 0
202+
fi
203+
fi
178204
fi
179205

180206
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
@@ -213,9 +239,9 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
213239
--build-cache-path "$ARDUINO_CACHE_DIR" \
214240
--build-path "$build_dir" \
215241
$xtra_opts "${sketchdir}" \
216-
> $output_file
242+
2>&1 | tee $output_file
217243

218-
exit_status=$?
244+
exit_status=${PIPESTATUS[0]}
219245
if [ $exit_status -ne 0 ]; then
220246
echo "ERROR: Compilation failed with error code $exit_status"
221247
exit $exit_status
@@ -322,9 +348,9 @@ function count_sketches(){ # count_sketches <path> [target] [file] [ignore-requi
322348
fi
323349

324350
if [ "$ignore_requirements" != "1" ]; then
325-
# Check if the sketch requires any configuration options
351+
# Check if the sketch requires any configuration options (AND)
326352
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
327-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
353+
if [[ "$requirements" != "null" && "$requirements" != "" ]]; then
328354
for requirement in $requirements; do
329355
requirement=$(echo $requirement | xargs)
330356
found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig)
@@ -333,6 +359,23 @@ function count_sketches(){ # count_sketches <path> [target] [file] [ignore-requi
333359
fi
334360
done
335361
fi
362+
363+
# Check if the sketch excludes any configuration options (OR)
364+
requirements_or=$(jq -r '.requires_any[]? // empty' $sketchdir/ci.json)
365+
if [[ "$requirements_or" != "null" && "$requirements_or" != "" ]]; then
366+
found=false
367+
for requirement in $requirements_or; do
368+
requirement=$(echo $requirement | xargs)
369+
found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig)
370+
if [[ "$found_line" != "" ]]; then
371+
found=true
372+
break
373+
fi
374+
done
375+
if [[ "$found" == "false" ]]; then
376+
continue 2
377+
fi
378+
fi
336379
fi
337380
fi
338381
echo $sketch >> sketches.txt

Diff for: .github/scripts/tests_matrix.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
build_types="'validation'"
4+
hw_types="'validation'"
5+
wokwi_types="'validation'"
6+
qemu_types="'validation'"
7+
8+
if [[ $IS_PR != 'true' ]] || [[ $PERFORMANCE_ENABLED == 'true' ]]; then
9+
build_types+=",'performance'"
10+
hw_types+=",'performance'"
11+
#wokwi_types+=",'performance'"
12+
#qemu_types+=",'performance'"
13+
fi
14+
15+
targets="'esp32','esp32s2','esp32s3','esp32c3','esp32c6','esp32h2'"
16+
17+
mkdir -p info
18+
19+
echo "[$wokwi_types]" > info/wokwi_types.txt
20+
echo "[$targets]" > info/targets.txt
21+
22+
echo "build-types=[$build_types]" >> $GITHUB_OUTPUT
23+
echo "hw-types=[$hw_types]" >> $GITHUB_OUTPUT
24+
echo "wokwi-types=[$wokwi_types]" >> $GITHUB_OUTPUT
25+
echo "qemu-types=[$qemu_types]" >> $GITHUB_OUTPUT
26+
echo "targets=[$targets]" >> $GITHUB_OUTPUT

Diff for: .github/scripts/tests_run.sh

+21-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ function run_test() {
3636
return 0
3737
fi
3838

39-
# Check if the sketch requires any configuration options
39+
# Check if the sketch requires any configuration options (AND)
4040
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
41-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
41+
if [[ "$requirements" != "null" && "$requirements" != "" ]]; then
4242
for requirement in $requirements; do
4343
requirement=$(echo $requirement | xargs)
4444
found_line=$(grep -E "^$requirement" "$SDKCONFIG_PATH")
@@ -49,6 +49,25 @@ function run_test() {
4949
fi
5050
done
5151
fi
52+
53+
# Check if the sketch requires any configuration options (OR)
54+
requirements_or=$(jq -r '.requires_any[]? // empty' $sketchdir/ci.json)
55+
if [[ "$requirements_or" != "null" && "$requirements_or" != "" ]]; then
56+
found=false
57+
for requirement in $requirements_or; do
58+
requirement=$(echo $requirement | xargs)
59+
found_line=$(grep -E "^$requirement" "$SDKCONFIG_PATH")
60+
if [[ "$found_line" != "" ]]; then
61+
found=true
62+
break
63+
fi
64+
done
65+
if [[ "$found" == "false" ]]; then
66+
printf "\033[93mTarget $target meets none of the requirements in requires_any for $sketchname. Skipping.\033[0m\n"
67+
printf "\n\n\n"
68+
return 0
69+
fi
70+
fi
5271
fi
5372

5473
if [ $len -eq 1 ]; then

Diff for: .github/workflows/dangerjs.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ jobs:
1919
- name: DangerJS pull request linter
2020
uses: espressif/shared-github-dangerjs@v1
2121
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
rule-max-commits: 'false'
24+
commit-messages-min-summary-length: '10'

0 commit comments

Comments
 (0)