Skip to content

Commit e7bb7fe

Browse files
Merge branch 'master' into webserver-filters
2 parents 1f498a1 + 1d895e5 commit e7bb7fe

19 files changed

+251
-113
lines changed

Diff for: .github/scripts/on-push.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ if [ "$BUILD_PIO" -eq 0 ]; then
108108

109109
if [ "$BUILD_LOG" -eq 1 ]; then
110110
#remove last comma from the last JSON object
111-
sed -i '$ s/.$//' "$sizes_file"
111+
sed -i '$ s/,$//' "$sizes_file"
112112
#echo end of JSON array
113113
echo "]}" >> $sizes_file
114114
fi

Diff for: .github/scripts/set_push_chunks.sh

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/bash
2+
3+
build_all=false
4+
chunks_count=0
5+
6+
if [[ $CORE_CHANGED == 'true' ]] || [[ $IS_PR != 'true' ]]; then
7+
echo "Core files changed or not a PR. Building all."
8+
build_all=true
9+
chunks_count=$MAX_CHUNKS
10+
elif [[ $LIB_CHANGED == 'true' ]]; then
11+
echo "Libraries changed. Building only affected sketches."
12+
if [[ $NETWORKING_CHANGED == 'true' ]]; then
13+
echo "Networking libraries changed. Building networking related sketches."
14+
networking_sketches="$(find libraries/WiFi -name *.ino) "
15+
networking_sketches+="$(find libraries/Ethernet -name *.ino) "
16+
networking_sketches+="$(find libraries/PPP -name *.ino) "
17+
networking_sketches+="$(find libraries/NetworkClientSecure -name *.ino) "
18+
networking_sketches+="$(find libraries/WebServer -name *.ino) "
19+
fi
20+
if [[ $FS_CHANGED == 'true' ]]; then
21+
echo "FS libraries changed. Building FS related sketches."
22+
fs_sketches="$(find libraries/SD -name *.ino) "
23+
fs_sketches+="$(find libraries/SD_MMC -name *.ino) "
24+
fs_sketches+="$(find libraries/SPIFFS -name *.ino) "
25+
fs_sketches+="$(find libraries/LittleFS -name *.ino) "
26+
fs_sketches+="$(find libraries/FFat -name *.ino) "
27+
fi
28+
sketches="$networking_sketches $fs_sketches"
29+
for file in $LIB_FILES; do
30+
if [[ $file == *.ino ]]; then
31+
# If file ends with .ino, add it to the list of sketches
32+
echo "Sketch found: $file"
33+
sketches+="$file "
34+
elif [[ $(basename $(dirname $file)) == "src" ]]; then
35+
# If file is in a src directory, find all sketches in the parent/examples directory
36+
echo "Library src file found: $file"
37+
lib=$(dirname $(dirname $file))
38+
if [[ -d $lib/examples ]]; then
39+
lib_sketches=$(find $lib/examples -name *.ino)
40+
sketches+="$lib_sketches "
41+
echo "Library sketches: $lib_sketches"
42+
fi
43+
else
44+
# If file is in a example folder but it is not a sketch, find all sketches in the current directory
45+
echo "File in example folder found: $file"
46+
sketch=$(find $(dirname $file) -name *.ino)
47+
sketches+="$sketch "
48+
echo "Sketch in example folder: $sketch"
49+
fi
50+
echo ""
51+
done
52+
fi
53+
54+
if [[ -n $sketches ]]; then
55+
# Remove duplicates
56+
sketches=$(echo $sketches | tr ' ' '\n' | sort | uniq)
57+
for sketch in $sketches; do
58+
echo $sketch >> sketches_found.txt
59+
chunks_count=$((chunks_count+1))
60+
done
61+
echo "Number of sketches found: $chunks_count"
62+
echo "Sketches:"
63+
echo "$sketches"
64+
65+
if [[ $chunks_count -gt $MAX_CHUNKS ]]; then
66+
echo "More sketches than the allowed number of chunks found. Limiting to $MAX_CHUNKS chunks."
67+
chunks_count=$MAX_CHUNKS
68+
fi
69+
fi
70+
71+
chunks='["0"'
72+
for i in $(seq 1 $(( $chunks_count - 1 )) ); do
73+
chunks+=",\"$i\""
74+
done
75+
chunks+="]"
76+
77+
echo "build_all=$build_all" >> $GITHUB_OUTPUT
78+
echo "build_libraries=$BUILD_LIBRARIES" >> $GITHUB_OUTPUT
79+
echo "build_static_sketches=$BUILD_STATIC_SKETCHES" >> $GITHUB_OUTPUT
80+
echo "build_idf=$BUILD_IDF" >> $GITHUB_OUTPUT
81+
echo "build_platformio=$BUILD_PLATFORMIO" >> $GITHUB_OUTPUT
82+
echo "chunk_count=$chunks_count" >> $GITHUB_OUTPUT
83+
echo "chunks=$chunks" >> $GITHUB_OUTPUT

Diff for: .github/scripts/sketch_utils.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
192192

193193
exit_status=$?
194194
if [ $exit_status -ne 0 ]; then
195-
echo ""ERROR: Compilation failed with error code $exit_status""
195+
echo "ERROR: Compilation failed with error code $exit_status"
196196
exit $exit_status
197197
fi
198198

@@ -236,7 +236,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
236236

237237
exit_status=$?
238238
if [ $exit_status -ne 0 ]; then
239-
echo ""ERROR: Compilation failed with error code $exit_status""
239+
echo "ERROR: Compilation failed with error code $exit_status"
240240
exit $exit_status
241241
fi
242242
# $ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
@@ -398,6 +398,7 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
398398
else
399399
start_index=$(( $chunk_index * $chunk_size ))
400400
if [ "$sketchcount" -le "$start_index" ]; then
401+
echo "No sketches to build for $target in this chunk"
401402
return 0
402403
fi
403404

@@ -437,7 +438,7 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
437438
continue
438439
fi
439440
echo ""
440-
echo "Building Sketch Index $(($sketchnum - 1)) - $sketchdirname"
441+
echo "Building Sketch Index $sketchnum - $sketchdirname"
441442
build_sketch $args -s $sketchdir $xtra_opts
442443
local result=$?
443444
if [ $result -ne 0 ]; then

Diff for: .github/scripts/tests_run.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,12 @@ function run_test() {
9595
printf "\033[95mpytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args\033[0m\n"
9696
bash -c "set +e; pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args; exit \$?" || result=$?
9797
printf "\n"
98-
result=$?
9998
if [ $result -ne 0 ]; then
99+
printf "\033[91mFailed test: $sketchname -- Config: $i\033[0m\n\n"
100100
error=$result
101101
fi
102102
fi
103103
done
104-
printf "Test return code: $error\n"
105104
return $error
106105
}
107106

@@ -250,7 +249,6 @@ else
250249

251250
exit_code=0
252251
run_test $target $sketch $options $erase || exit_code=$?
253-
echo "Sketch $sketch exit code: $exit_code"
254252
if [ $exit_code -ne 0 ]; then
255253
error=$exit_code
256254
fi

Diff for: .github/workflows/hw.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,16 @@ jobs:
7777
run: |
7878
pip install -U pip
7979
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
80+
apt update
81+
apt install -y jq
8082
8183
- name: Get binaries
82-
id: cache-build-binaries
83-
uses: actions/cache/restore@v4
8484
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
85+
uses: actions/download-artifact@v4
8586
with:
86-
fail-on-cache-miss: true
87-
key: tests-${{ env.id }}-bin
87+
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
8888
path: |
89-
~/.arduino/tests/**/build*.tmp/*.bin
90-
~/.arduino/tests/**/build*.tmp/*.elf
91-
~/.arduino/tests/**/build*.tmp/*.json
89+
~/.arduino/tests
9290
9391
- name: Run Tests
9492
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

Diff for: .github/workflows/lib.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ jobs:
120120

121121
- name: Push to github repo
122122
run: |
123-
git config user.name github-actions
124-
git config user.email github-actions@github.com
123+
git config user.name "github-actions[bot]"
124+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
125125
git add ${{ env.RESULT_LIBRARY_TEST_FILE }}
126126
git commit -m "Generated External Libraries Test Results"
127127
git push origin HEAD:gh-pages

Diff for: .github/workflows/publishsizes-2.x.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ jobs:
3232
run: |
3333
mv master_cli_compile/*.json artifacts/sizes-report/pr/
3434
mv v2.x_cli_compile/*.json artifacts/sizes-report/master/
35-
35+
3636
- name: Report results
3737
uses: P-R-O-C-H-Y/report-size-deltas@sizes_v2
3838
with:
3939
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
4040
github-token: ${{ env.GITHUB_TOKEN }}
4141
destination-file: ${{ env.RESULT_SIZES_TEST_FILE }}
42-
42+
4343
- name: Append file with action URL
4444
run:
4545
echo "/ [GitHub Action Link](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})" >> ${{ env.RESULT_SIZES_TEST_FILE }}
4646

4747
- name: Push to github repo
4848
run: |
49-
git config user.name github-actions
50-
git config user.email github-actions@github.com
49+
git config user.name "github-actions[bot]"
50+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
5151
git add ${{ env.RESULT_SIZES_TEST_FILE }}
5252
git commit -m "Generated Sizes Results (master-v2.x)"
5353
git push origin HEAD:gh-pages

Diff for: .github/workflows/push.yml

+18-73
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ jobs:
7777
libraries:
7878
- 'libraries/**/examples/**'
7979
- 'libraries/**/src/**'
80+
networking:
81+
- 'libraries/Network/src/**'
82+
fs:
83+
- 'libraries/FS/src/**'
8084
static_sketeches:
8185
- 'libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino'
8286
- 'libraries/BLE/examples/Server/Server.ino'
@@ -97,78 +101,18 @@ jobs:
97101
id: set-chunks
98102
env:
99103
LIB_FILES: ${{ steps.changed-files.outputs.libraries_all_changed_files }}
104+
IS_PR: ${{ github.event_name == 'pull_request' }}
105+
MAX_CHUNKS: ${{ env.MAX_CHUNKS }}
106+
BUILD_PLATFORMIO: ${{ steps.changed-files.outputs.platformio_any_changed == 'true' }}
107+
BUILD_IDF: ${{ steps.changed-files.outputs.idf_any_changed == 'true' }}
108+
BUILD_LIBRARIES: ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
109+
BUILD_STATIC_SKETCHES: ${{ steps.changed-files.outputs.static_sketeches_any_changed == 'true' }}
110+
FS_CHANGED: ${{ steps.changed-files.outputs.fs_any_changed == 'true' }}
111+
NETWORKING_CHANGED: ${{ steps.changed-files.outputs.networking_any_changed == 'true' }}
112+
CORE_CHANGED: ${{ steps.changed-files.outputs.core_any_changed == 'true' }}
113+
LIB_CHANGED: ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
100114
run: |
101-
build_all=false
102-
chunks_count=0
103-
is_pr=${{ github.event_name == 'pull_request' }}
104-
105-
build_platformio=${{ steps.changed-files.outputs.platformio_any_changed == 'true' }}
106-
build_idf=${{ steps.changed-files.outputs.idf_any_changed == 'true' }}
107-
build_libraries=${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
108-
build_static_sketches=${{ steps.changed-files.outputs.static_sketeches_any_changed == 'true' }}
109-
110-
core_changed=${{ steps.changed-files.outputs.core_any_changed == 'true' }}
111-
lib_changed=${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
112-
113-
if [[ $core_changed == 'true' ]] || [[ $is_pr != 'true' ]]; then
114-
echo "Core files changed or not a PR. Building all."
115-
build_all=true
116-
chunks_count=${{ env.MAX_CHUNKS }}
117-
elif [[ $lib_changed == 'true' ]]; then
118-
echo "Libraries changed. Building only affected sketches."
119-
sketches=""
120-
for file in $LIB_FILES; do
121-
if [[ $file == *.ino ]]; then
122-
# If file ends with .ino, add it to the list of sketches
123-
echo "Sketch found: $file"
124-
sketches+="$file "
125-
elif [[ $(basename $(dirname $file)) == "src" ]]; then
126-
# If file is in a src directory, find all sketches in the parent/examples directory
127-
echo "Library src file found: $file"
128-
lib=$(dirname $(dirname $file))
129-
lib_sketches=$(find $lib/examples -name *.ino)
130-
sketches+="$lib_sketches "
131-
echo "Library sketches: $lib_sketches"
132-
else
133-
# If file is in a example folder but it is not a sketch, find all sketches in the current directory
134-
echo "File in example folder found: $file"
135-
sketch=$(find $(dirname $file) -name *.ino)
136-
sketches+="$sketch "
137-
echo "Sketch in example folder: $sketch"
138-
fi
139-
echo ""
140-
done
141-
fi
142-
143-
if [[ -n $sketches ]]; then
144-
# Remove duplicates
145-
sketches=$(echo $sketches | tr ' ' '\n' | sort | uniq)
146-
for sketch in $sketches; do
147-
echo $sketch >> sketches_found.txt
148-
chunks_count=$((chunks_count+1))
149-
done
150-
echo "Number of sketches found: $chunks_count"
151-
echo "Sketches: $sketches"
152-
153-
if [[ $chunks_count -gt ${{ env.MAX_CHUNKS }} ]]; then
154-
echo "More sketches than the allowed number of chunks found. Limiting to ${{ env.MAX_CHUNKS }} chunks."
155-
chunks_count=${{ env.MAX_CHUNKS }}
156-
fi
157-
fi
158-
159-
chunks='["0"'
160-
for i in $(seq 1 $(( $chunks_count - 1 )) ); do
161-
chunks+=",\"$i\""
162-
done
163-
chunks+="]"
164-
165-
echo "build_all=$build_all" >> $GITHUB_OUTPUT
166-
echo "build_libraries=$build_libraries" >> $GITHUB_OUTPUT
167-
echo "build_static_sketches=$build_static_sketches" >> $GITHUB_OUTPUT
168-
echo "build_idf=$build_idf" >> $GITHUB_OUTPUT
169-
echo "build_platformio=$build_platformio" >> $GITHUB_OUTPUT
170-
echo "chunk_count=$chunks_count" >> $GITHUB_OUTPUT
171-
echo "chunks=$chunks" >> $GITHUB_OUTPUT
115+
bash ./.github/scripts/set_push_chunks.sh
172116
173117
- name: Upload sketches found
174118
if: ${{ steps.set-chunks.outputs.build_all == 'false' && steps.set-chunks.outputs.build_libraries == 'true' }}
@@ -336,9 +280,10 @@ jobs:
336280

337281
- name: Commit json files to gh-pages if on master
338282
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
283+
continue-on-error: true
339284
run: |
340-
git config user.name github-actions
341-
git config user.email github-actions@github.com
285+
git config user.name "github-actions[bot]"
286+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
342287
git add --all
343288
git commit -m "Updated cli compile json files"
344289
git push origin HEAD:gh-pages

Diff for: .github/workflows/qemu.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,11 @@ jobs:
113113
114114
- name: Get binaries
115115
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
116-
id: cache-build-binaries
117-
uses: actions/cache/restore@v4
116+
uses: actions/download-artifact@v4
118117
with:
119-
fail-on-cache-miss: true
120-
key: tests-${{ env.id }}-bin
118+
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
121119
path: |
122-
~/.arduino/tests/**/build*.tmp/*.bin
123-
~/.arduino/tests/**/build*.tmp/*.elf
124-
~/.arduino/tests/**/build*.tmp/*.json
120+
~/.arduino/tests
125121
126122
- name: Run Tests
127123
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

Diff for: .github/workflows/wokwi.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,11 @@ jobs:
9191

9292
- name: Get binaries
9393
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
94-
id: cache-build-binaries
95-
uses: actions/cache/restore@v4
94+
uses: actions/download-artifact@v4
9695
with:
97-
fail-on-cache-miss: true
98-
key: tests-${{ env.id }}-bin
96+
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
9997
path: |
100-
~/.arduino/tests/**/build*.tmp/*.bin
101-
~/.arduino/tests/**/build*.tmp/*.elf
102-
~/.arduino/tests/**/build*.tmp/*.json
98+
~/.arduino/tests
10399
104100
- name: Run Tests
105101
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

Diff for: cores/esp32/chip-debug-report.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ static void printChipInfo(void) {
9696
chip_report_printf(" Cores : %d\n", info.cores);
9797
rtc_cpu_freq_config_t conf;
9898
rtc_clk_cpu_freq_get_config(&conf);
99-
chip_report_printf(" Frequency : %lu MHz\n", conf.freq_mhz);
99+
chip_report_printf(" CPU Frequency : %lu MHz\n", conf.freq_mhz);
100+
chip_report_printf(" XTAL Frequency : %d MHz\n", rtc_clk_xtal_freq_get());
100101
chip_report_printf(" Embedded Flash : %s\n", (info.features & CHIP_FEATURE_EMB_FLASH) ? "Yes" : "No");
101102
chip_report_printf(" Embedded PSRAM : %s\n", (info.features & CHIP_FEATURE_EMB_PSRAM) ? "Yes" : "No");
102103
chip_report_printf(" 2.4GHz WiFi : %s\n", (info.features & CHIP_FEATURE_WIFI_BGN) ? "Yes" : "No");

Diff for: cores/esp32/esp32-hal-misc.c

-3
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@ extern bool btInUse();
252252
void initArduino() {
253253
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
254254
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
255-
#ifdef F_CPU
256-
setCpuFrequencyMhz(F_CPU / 1000000);
257-
#endif
258255
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
259256
psramInit();
260257
#endif

0 commit comments

Comments
 (0)