Skip to content

Commit 03bfa52

Browse files
committed
Merge branch 'master' into release/v3.1.x
2 parents 83d3568 + 9e643c0 commit 03bfa52

24 files changed

+279
-99
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/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

+64-20
Original file line numberDiff line numberDiff line change
@@ -98,38 +98,47 @@ 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}"
107-
esp32p4_opts="FlashMode=dio,USBMode=default${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"
107+
esp32p4_opts="USBMode=default${fqbn_append:+,$fqbn_append}"
108108

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

112+
opt=""
113+
112114
case "$target" in
113115
"esp32")
114-
fqbn="espressif:esp32:esp32:${options:-$esp32_opts}"
116+
[ -n "${options:-$esp32_opts}" ] && opt=":${options:-$esp32_opts}"
117+
fqbn="espressif:esp32:esp32$opt"
115118
;;
116119
"esp32s2")
117-
fqbn="espressif:esp32:esp32s2:${options:-$esp32s2_opts}"
120+
[ -n "${options:-$esp32s2_opts}" ] && opt=":${options:-$esp32s2_opts}"
121+
fqbn="espressif:esp32:esp32s2$opt"
118122
;;
119123
"esp32c3")
120-
fqbn="espressif:esp32:esp32c3:${options:-$esp32c3_opts}"
124+
[ -n "${options:-$esp32c3_opts}" ] && opt=":${options:-$esp32c3_opts}"
125+
fqbn="espressif:esp32:esp32c3$opt"
121126
;;
122127
"esp32s3")
123-
fqbn="espressif:esp32:esp32s3:${options:-$esp32s3_opts}"
128+
[ -n "${options:-$esp32s3_opts}" ] && opt=":${options:-$esp32s3_opts}"
129+
fqbn="espressif:esp32:esp32s3$opt"
124130
;;
125131
"esp32c6")
126-
fqbn="espressif:esp32:esp32c6:${options:-$esp32c6_opts}"
132+
[ -n "${options:-$esp32c6_opts}" ] && opt=":${options:-$esp32c6_opts}"
133+
fqbn="espressif:esp32:esp32c6$opt"
127134
;;
128135
"esp32h2")
129-
fqbn="espressif:esp32:esp32h2:${options:-$esp32h2_opts}"
136+
[ -n "${options:-$esp32h2_opts}" ] && opt=":${options:-$esp32h2_opts}"
137+
fqbn="espressif:esp32:esp32h2$opt"
130138
;;
131139
"esp32p4")
132-
fqbn="espressif:esp32:esp32p4:${options:-$esp32p4_opts}"
140+
[ -n "${options:-$esp32p4_opts}" ] && opt=":${options:-$esp32p4_opts}"
141+
fqbn="espressif:esp32:esp32p4$opt"
133142
;;
134143
esac
135144

@@ -167,9 +176,9 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
167176
exit 0
168177
fi
169178

170-
# Check if the sketch requires any configuration options
179+
# Check if the sketch requires any configuration options (AND)
171180
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
172-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
181+
if [[ "$requirements" != "null" && "$requirements" != "" ]]; then
173182
for requirement in $requirements; do
174183
requirement=$(echo $requirement | xargs)
175184
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/$target/sdkconfig")
@@ -179,6 +188,24 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
179188
fi
180189
done
181190
fi
191+
192+
# Check if the sketch excludes any configuration options (OR)
193+
requirements_or=$(jq -r '.requires_any[]? // empty' $sketchdir/ci.json)
194+
if [[ "$requirements_or" != "null" && "$requirements_or" != "" ]]; then
195+
found=false
196+
for requirement in $requirements_or; do
197+
requirement=$(echo $requirement | xargs)
198+
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/$target/sdkconfig")
199+
if [[ "$found_line" != "" ]]; then
200+
found=true
201+
break
202+
fi
203+
done
204+
if [[ "$found" == "false" ]]; then
205+
echo "Target $target meets none of the requirements in requires_any for $sketchname. Skipping."
206+
exit 0
207+
fi
208+
fi
182209
fi
183210

184211
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
@@ -217,9 +244,9 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
217244
--build-cache-path "$ARDUINO_CACHE_DIR" \
218245
--build-path "$build_dir" \
219246
$xtra_opts "${sketchdir}" \
220-
> $output_file
247+
2>&1 | tee $output_file
221248

222-
exit_status=$?
249+
exit_status=${PIPESTATUS[0]}
223250
if [ $exit_status -ne 0 ]; then
224251
echo "ERROR: Compilation failed with error code $exit_status"
225252
exit $exit_status
@@ -326,9 +353,9 @@ function count_sketches(){ # count_sketches <path> [target] [file] [ignore-requi
326353
fi
327354

328355
if [ "$ignore_requirements" != "1" ]; then
329-
# Check if the sketch requires any configuration options
356+
# Check if the sketch requires any configuration options (AND)
330357
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
331-
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
358+
if [[ "$requirements" != "null" && "$requirements" != "" ]]; then
332359
for requirement in $requirements; do
333360
requirement=$(echo $requirement | xargs)
334361
found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig)
@@ -337,6 +364,23 @@ function count_sketches(){ # count_sketches <path> [target] [file] [ignore-requi
337364
fi
338365
done
339366
fi
367+
368+
# Check if the sketch excludes any configuration options (OR)
369+
requirements_or=$(jq -r '.requires_any[]? // empty' $sketchdir/ci.json)
370+
if [[ "$requirements_or" != "null" && "$requirements_or" != "" ]]; then
371+
found=false
372+
for requirement in $requirements_or; do
373+
requirement=$(echo $requirement | xargs)
374+
found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig)
375+
if [[ "$found_line" != "" ]]; then
376+
found=true
377+
break
378+
fi
379+
done
380+
if [[ "$found" == "false" ]]; then
381+
continue 2
382+
fi
383+
fi
340384
fi
341385
fi
342386
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'

Diff for: .github/workflows/tests.yml

+17-21
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,25 @@ jobs:
5757
hw-types: ${{ steps.set-matrix.outputs.hw-types }}
5858
wokwi-types: ${{ steps.set-matrix.outputs.wokwi-types }}
5959
qemu-types: ${{ steps.set-matrix.outputs.qemu-types }}
60+
targets: ${{ steps.set-matrix.outputs.targets }}
61+
env:
62+
IS_PR: ${{ github.event.pull_request.number != null }}
63+
PERFORMANCE_ENABLED: ${{ contains(github.event.pull_request.labels.*.name, 'perf_test') }}
6064
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
with:
68+
sparse-checkout: .github/scripts/tests_matrix.sh
69+
6170
- name: Set matrix
6271
id: set-matrix
63-
run: |
64-
build_types='["validation"'
65-
hw_types='["validation"'
66-
wokwi_types='["validation"'
67-
qemu_types='["validation"'
68-
69-
is_pr=${{ github.event.pull_request.number != null }}
70-
is_performance_enabled=${{ contains(github.event.pull_request.labels.*.name, 'perf_test') }}
71-
72-
if [[ $is_pr != 'true' ]] || [[ $is_performance_enabled == 'true' ]]; then
73-
build_types+=',"performance"'
74-
hw_types+=',"performance"'
75-
#wokwi_types+=',"performance"'
76-
#qemu_types+=',"performance"'
77-
fi
72+
run: bash .github/scripts/tests_matrix.sh
7873

79-
echo "build-types=$build_types]" >> $GITHUB_OUTPUT
80-
echo "hw-types=$hw_types]" >> $GITHUB_OUTPUT
81-
echo "wokwi-types=$wokwi_types]" >> $GITHUB_OUTPUT
82-
echo "qemu-types=$qemu_types]" >> $GITHUB_OUTPUT
74+
- name: Upload
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: matrix_info
78+
path: info/*
8379

8480
call-build-tests:
8581
name: Build
@@ -88,7 +84,7 @@ jobs:
8884
strategy:
8985
matrix:
9086
type: ${{ fromJson(needs.gen-matrix.outputs.build-types) }}
91-
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4']
87+
chip: ${{ fromJson(needs.gen-matrix.outputs.targets) }}
9288
with:
9389
type: ${{ matrix.type }}
9490
chip: ${{ matrix.chip }}
@@ -105,7 +101,7 @@ jobs:
105101
fail-fast: false
106102
matrix:
107103
type: ${{ fromJson(needs.gen-matrix.outputs.hw-types) }}
108-
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4']
104+
chip: ${{ fromJson(needs.gen-matrix.outputs.targets) }}
109105
with:
110106
type: ${{ matrix.type }}
111107
chip: ${{ matrix.chip }}

Diff for: .github/workflows/tests_results.yml

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
event_name: ${{ env.original_event }}
8080
files: ./artifacts/**/*.xml
8181
action_fail: true
82+
compare_to_earlier_commit: false
8283

8384
- name: Fail if tests failed
8485
if: ${{ env.original_conclusion == 'failure' || env.original_conclusion == 'timed_out' || github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out' }}

0 commit comments

Comments
 (0)