Skip to content

Commit 75c3c75

Browse files
committed
Merge branch 'HEAD' of [email protected]:greenyleaf/arduino-esp32.git
2 parents fa899cd + 4557316 commit 75c3c75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1154
-525
lines changed

Diff for: .github/scripts/set_push_chunks.sh

+90-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,93 @@
22

33
build_all=false
44
chunks_count=0
5+
last_check_files=""
6+
last_check_result=""
7+
gh_output=""
8+
9+
# Define the file patterns
10+
core_files=(
11+
'\.github/.*'
12+
'cores/.*'
13+
'package/.*'
14+
'tools/.*'
15+
'platform\.txt'
16+
'programmers\.txt'
17+
'variants/esp32/.*'
18+
'variants/esp32c3/.*'
19+
'variants/esp32c6/.*'
20+
'variants/esp32h2/.*'
21+
'variants/esp32p4/.*'
22+
'variants/esp32s2/.*'
23+
'variants/esp32s3/.*'
24+
)
25+
library_files=(
26+
'libraries/.*/examples/.*'
27+
'libraries/.*/src/.*'
28+
)
29+
networking_files=(
30+
'libraries/Network/src/.*'
31+
)
32+
fs_files=(
33+
'libraries/FS/src/.*'
34+
)
35+
static_sketches_files=(
36+
'libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure\.ino'
37+
'libraries/BLE/examples/Server/Server\.ino'
38+
'libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer\.ino'
39+
'libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics\.ino'
40+
'libraries/NetworkClientSecure/src/.*'
41+
'libraries/BLE/src/.*'
42+
'libraries/Insights/src/.*'
43+
)
44+
idf_files=(
45+
'idf_component\.yml'
46+
'Kconfig\.projbuild'
47+
'CMakeLists\.txt'
48+
'variants/esp32c2/.*'
49+
)
50+
51+
# Function to check if any files match the patterns
52+
check_files() {
53+
local patterns=("$@")
54+
local files_found=""
55+
for pattern in "${patterns[@]}"; do
56+
echo "Checking pattern: $pattern"
57+
matched_files=$(echo "$gh_output" | grep -E "$pattern")
58+
echo "matched_files: $matched_files"
59+
files_found+="$matched_files "
60+
done
61+
62+
last_check_files=$(echo "$files_found" | xargs)
63+
if [[ -n $last_check_files ]]; then
64+
last_check_result="true"
65+
else
66+
last_check_result="false"
67+
fi
68+
echo "last_check_result: $last_check_result"
69+
}
70+
71+
if [[ $IS_PR != 'true' ]]; then
72+
gh_output=$(gh api repos/espressif/arduino-esp32/commits/"$GITHUB_SHA" --jq '.files[].filename')
73+
else
74+
gh_output=$(gh pr diff "$PR_NUM" --name-only)
75+
fi
76+
echo "gh_output: $gh_output"
77+
78+
# Output the results
79+
check_files "${core_files[@]}"
80+
CORE_CHANGED=$last_check_result
81+
check_files "${library_files[@]}"
82+
LIB_CHANGED=$last_check_result
83+
LIB_FILES=$last_check_files
84+
check_files "${networking_files[@]}"
85+
NETWORKING_CHANGED=$last_check_result
86+
check_files "${fs_files[@]}"
87+
FS_CHANGED=$last_check_result
88+
check_files "${static_sketches_files[@]}"
89+
STATIC_SKETCHES_CHANGED=$last_check_result
90+
check_files "${idf_files[@]}"
91+
IDF_CHANGED=$last_check_result
592

693
if [[ $CORE_CHANGED == 'true' ]] || [[ $IS_PR != 'true' ]]; then
794
echo "Core files changed or not a PR. Building all."
@@ -76,9 +163,9 @@ chunks+="]"
76163

77164
{
78165
echo "build_all=$build_all"
79-
echo "build_libraries=$BUILD_LIBRARIES"
80-
echo "build_static_sketches=$BUILD_STATIC_SKETCHES"
81-
echo "build_idf=$BUILD_IDF"
166+
echo "build_libraries=$LIB_CHANGED"
167+
echo "build_static_sketches=$STATIC_SKETCHES_CHANGED"
168+
echo "build_idf=$IDF_CHANGED"
82169
echo "chunk_count=$chunks_count"
83170
echo "chunks=$chunks"
84171
} >> "$GITHUB_OUTPUT"

Diff for: .github/scripts/sketch_utils.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
244244
build_dir="$ARDUINO_BUILD_DIR"
245245
elif [ "$len" -eq 1 ]; then
246246
# build_dir="$sketchdir/build"
247-
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
247+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build.tmp"
248248
fi
249249

250250
output_file="$HOME/.arduino/cli_compile_output.txt"
@@ -254,7 +254,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
254254
for i in $(seq 0 $((len - 1))); do
255255
if [ "$len" -ne 1 ]; then
256256
# build_dir="$sketchdir/build$i"
257-
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
257+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build$i.tmp"
258258
fi
259259
rm -rf "$build_dir"
260260
mkdir -p "$build_dir"

Diff for: .github/scripts/tests_run.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ function run_test {
2727
fi
2828

2929
if [ "$len" -eq 1 ]; then
30-
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build.tmp/sdkconfig"
30+
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build.tmp/sdkconfig"
3131
else
32-
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build0.tmp/sdkconfig"
32+
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build0.tmp/sdkconfig"
3333
fi
3434

3535
if [ -f "$sketchdir"/ci.json ]; then
@@ -45,7 +45,7 @@ function run_test {
4545
fi
4646

4747
if [ ! -f "$sdkconfig_path" ]; then
48-
printf "\033[93mSketch %s not built\nMight be due to missing target requirements or build failure\033[0m\n" "$sketchname"
48+
printf "\033[93mSketch %s build not found in %s\nMight be due to missing target requirements or build failure\033[0m\n" "$(dirname "$sdkconfig_path")" "$sketchname"
4949
printf "\n\n\n"
5050
return 0
5151
fi
@@ -60,7 +60,7 @@ function run_test {
6060

6161
if [ "$len" -eq 1 ]; then
6262
# build_dir="$sketchdir/build"
63-
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
63+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build.tmp"
6464
report_file="$sketchdir/$target/$sketchname.xml"
6565
fi
6666

@@ -83,7 +83,7 @@ function run_test {
8383

8484
if [ "$len" -ne 1 ]; then
8585
# build_dir="$sketchdir/build$i"
86-
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
86+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build$i.tmp"
8787
report_file="$sketchdir/$target/$sketchname$i.xml"
8888
fi
8989

Diff for: .github/workflows/build_py_tools.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ jobs:
3030
echo "Make sure you are using a branch inside the repository and not a fork."
3131
3232
- name: Verify Python Tools Changed
33-
uses: tj-actions/changed-files@v41
3433
id: verify-changed-files
35-
with:
36-
fetch_depth: "2"
37-
since_last_remote_commit: "true"
38-
files: |
39-
tools/get.py
40-
tools/espota.py
41-
tools/gen_esp32part.py
42-
tools/gen_insights_package.py
34+
run: |
35+
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r ^HEAD -- tools/get.py tools/espota.py tools/gen_esp32part.py tools/gen_insights_package.py | xargs)
36+
echo "all_changed_files=$CHANGED_FILES" >> $GITHUB_OUTPUT
37+
if [ -n "$CHANGED_FILES" ]; then
38+
echo "any_changed=true" >> $GITHUB_OUTPUT
39+
else
40+
echo "any_changed=false" >> $GITHUB_OUTPUT
41+
fi
42+
4343
- name: List all changed files
4444
shell: bash
4545
run: |

Diff for: .github/workflows/pre-commit.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,22 @@ jobs:
5858

5959
- name: Get changed files
6060
id: changed-files
61-
uses: tj-actions/[email protected]
61+
env:
62+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
PR_NUM: ${{ github.event.pull_request.number }}
64+
IS_PR: ${{ github.event_name == 'pull_request' }}
65+
GITHUB_SHA: ${{ github.sha }}
66+
run: |
67+
if [[ $IS_PR != 'true' ]]; then
68+
files_changed=$(gh api repos/espressif/arduino-esp32/commits/"$GITHUB_SHA" --jq '.files[].filename' | xargs)
69+
else
70+
files_changed=$(gh pr diff "$PR_NUM" --name-only | xargs)
71+
fi
72+
echo "all_changed_files=$files_changed" >> $GITHUB_OUTPUT
73+
echo "Changed files:"
74+
for file in $files_changed; do
75+
echo " $file"
76+
done
6277
6378
- name: Run pre-commit hooks in changed files
6479
run: pre-commit run --color=always --show-diff-on-failure --files ${{ steps.changed-files.outputs.all_changed_files }}

Diff for: .github/workflows/push.yml

+5-49
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ on:
4545
- "!.github/scripts/tests_*"
4646
- "!.github/scripts/upload_*"
4747
- "variants/esp32/**/*"
48-
- "variants/esp32s2/**/*"
49-
- "variants/esp32s3/**/*"
5048
- "variants/esp32c2/**/*"
5149
- "variants/esp32c3/**/*"
5250
- "variants/esp32c6/**/*"
5351
- "variants/esp32h2/**/*"
52+
- "variants/esp32p4/**/*"
53+
- "variants/esp32s2/**/*"
54+
- "variants/esp32s3/**/*"
5455

5556
concurrency:
5657
group: build-${{github.event.pull_request.number || github.ref}}
@@ -85,58 +86,13 @@ jobs:
8586
with:
8687
fetch-depth: 2
8788

88-
- name: Get changed files
89-
id: changed-files
90-
uses: tj-actions/changed-files@v44
91-
with:
92-
files_yaml: |
93-
core:
94-
- '.github/**'
95-
- 'cores/**'
96-
- 'package/**'
97-
- 'tools/**'
98-
- 'platform.txt'
99-
- 'programmers.txt'
100-
- "variants/esp32/**/*"
101-
- "variants/esp32s2/**/*"
102-
- "variants/esp32s3/**/*"
103-
- "variants/esp32c3/**/*"
104-
- "variants/esp32c6/**/*"
105-
- "variants/esp32h2/**/*"
106-
libraries:
107-
- 'libraries/**/examples/**'
108-
- 'libraries/**/src/**'
109-
networking:
110-
- 'libraries/Network/src/**'
111-
fs:
112-
- 'libraries/FS/src/**'
113-
static_sketeches:
114-
- 'libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino'
115-
- 'libraries/BLE/examples/Server/Server.ino'
116-
- 'libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino'
117-
- 'libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics.ino'
118-
- 'libraries/NetworkClientSecure/src/**'
119-
- 'libraries/BLE/src/**'
120-
- 'libraries/Insights/src/**'
121-
idf:
122-
- 'idf_component.yml'
123-
- 'Kconfig.projbuild'
124-
- 'CMakeLists.txt'
125-
- "variants/esp32c2/**/*"
126-
12789
- name: Set chunks
12890
id: set-chunks
12991
env:
130-
LIB_FILES: ${{ steps.changed-files.outputs.libraries_all_changed_files }}
13192
IS_PR: ${{ github.event_name == 'pull_request' }}
93+
PR_NUM: ${{ github.event.pull_request.number }}
13294
MAX_CHUNKS: ${{ env.MAX_CHUNKS }}
133-
BUILD_IDF: ${{ steps.changed-files.outputs.idf_any_changed == 'true' }}
134-
BUILD_LIBRARIES: ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
135-
BUILD_STATIC_SKETCHES: ${{ steps.changed-files.outputs.static_sketeches_any_changed == 'true' }}
136-
FS_CHANGED: ${{ steps.changed-files.outputs.fs_any_changed == 'true' }}
137-
NETWORKING_CHANGED: ${{ steps.changed-files.outputs.networking_any_changed == 'true' }}
138-
CORE_CHANGED: ${{ steps.changed-files.outputs.core_any_changed == 'true' }}
139-
LIB_CHANGED: ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
95+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14096
run: |
14197
bash ./.github/scripts/set_push_chunks.sh
14298

Diff for: .github/workflows/tests_build.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
with:
2727
key: tests-${{ env.id }}-bin
2828
path: |
29-
~/.arduino/tests/**/build*.tmp/*.bin
30-
~/.arduino/tests/**/build*.tmp/*.elf
31-
~/.arduino/tests/**/build*.tmp/*.json
32-
~/.arduino/tests/**/build*.tmp/sdkconfig
29+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
30+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
31+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.json
32+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig
3333
3434
- name: Evaluate if tests should be built
3535
id: check-build
@@ -73,18 +73,18 @@ jobs:
7373
with:
7474
key: tests-${{ env.id }}-bin
7575
path: |
76-
~/.arduino/tests/**/build*.tmp/*.bin
77-
~/.arduino/tests/**/build*.tmp/*.elf
78-
~/.arduino/tests/**/build*.tmp/*.json
79-
~/.arduino/tests/**/build*.tmp/sdkconfig
76+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
77+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
78+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.json
79+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig
8080
8181
- name: Upload ${{ inputs.chip }} ${{ inputs.type }} binaries as artifacts
8282
uses: actions/upload-artifact@v4
8383
with:
8484
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
8585
overwrite: true
8686
path: |
87-
~/.arduino/tests/**/build*.tmp/*.bin
88-
~/.arduino/tests/**/build*.tmp/*.elf
89-
~/.arduino/tests/**/build*.tmp/*.json
90-
~/.arduino/tests/**/build*.tmp/sdkconfig
87+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
88+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
89+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.json
90+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig

Diff for: .github/workflows/tests_hw.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ defaults:
2222
jobs:
2323
hardware-test:
2424
name: Hardware ${{ inputs.chip }} ${{ inputs.type }} tests
25-
runs-on: [arduino, "${{ inputs.chip }}"]
25+
runs-on: ["arduino", "${{ inputs.chip }}"]
2626
env:
2727
id: ${{ github.event.pull_request.number || github.ref }}-${{ github.event.pull_request.head.sha || github.sha }}-${{ inputs.chip }}-${{ inputs.type }}
2828
container:
2929
image: python:3.10.1-bullseye
30-
options: --privileged
30+
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
3131
steps:
32+
- name: Clean workspace
33+
run: |
34+
rm -rf ./*
35+
rm -rf ~/.arduino/tests
36+
3237
- name: Check if already passed
3338
id: cache-results
3439
if: github.event.pull_request.number != null
@@ -81,7 +86,12 @@ jobs:
8186
with:
8287
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
8388
path: |
84-
~/.arduino/tests
89+
~/.arduino/tests/${{ inputs.chip }}
90+
91+
- name: List binaries
92+
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
93+
run: |
94+
ls -laR ~/.arduino/tests
8595
8696
- name: Run Tests
8797
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

Diff for: .github/workflows/tests_qemu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
with:
118118
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
119119
path: |
120-
~/.arduino/tests
120+
~/.arduino/tests/${{ inputs.chip }}
121121
122122
- name: Run Tests
123123
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

Diff for: .github/workflows/tests_wokwi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ jobs:
276276
run-id: ${{ github.event.workflow_run.id }}
277277
name: tests-bin-${{ matrix.chip }}-${{ matrix.type }}
278278
path: |
279-
~/.arduino/tests
279+
~/.arduino/tests/${{ matrix.chip }}
280280
281281
- name: Run Tests
282282
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

Diff for: CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ set(ARDUINO_LIBRARY_Zigbee_SRCS
298298
libraries/Zigbee/src/ep/ZigbeeAnalog.cpp
299299
libraries/Zigbee/src/ep/ZigbeeRangeExtender.cpp
300300
libraries/Zigbee/src/ep/ZigbeeGateway.cpp
301+
libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp
301302
)
302303

303304
set(ARDUINO_LIBRARY_BLE_SRCS

0 commit comments

Comments
 (0)