Skip to content

Commit c46f425

Browse files
authored
Merge branch 'master' into BLEAdvertising-return-codes
2 parents 1093646 + 66abd86 commit c46f425

File tree

229 files changed

+7334
-1320
lines changed

Some content is hidden

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

229 files changed

+7334
-1320
lines changed

.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.1.2
45+
- v3.1.1
4446
- v3.1.0
4547
- v3.0.7
4648
- v3.0.6

.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"

.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"

.github/scripts/tests_run.sh

+15-13
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ function run_test {
1111
local error=0
1212
local sdkconfig_path
1313
local extra_args
14+
local test_type
1415

1516
sketchdir=$(dirname "$sketch")
1617
sketchname=$(basename "$sketchdir")
18+
test_type=$(basename "$(dirname "$sketchdir")")
1719

1820
if [ "$options" -eq 0 ] && [ -f "$sketchdir"/ci.json ]; then
1921
len=$(jq -r --arg target "$target" '.fqbn[$target] | length' "$sketchdir"/ci.json)
@@ -25,9 +27,9 @@ function run_test {
2527
fi
2628

2729
if [ "$len" -eq 1 ]; then
28-
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build.tmp/sdkconfig"
30+
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build.tmp/sdkconfig"
2931
else
30-
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build0.tmp/sdkconfig"
32+
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build0.tmp/sdkconfig"
3133
fi
3234

3335
if [ -f "$sketchdir"/ci.json ]; then
@@ -43,22 +45,22 @@ function run_test {
4345
fi
4446

4547
if [ ! -f "$sdkconfig_path" ]; then
46-
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"
4749
printf "\n\n\n"
4850
return 0
4951
fi
5052

51-
local right_target
52-
right_target=$(grep -E "^CONFIG_IDF_TARGET=\"$target\"$" "$sdkconfig_path")
53-
if [ -z "$right_target" ]; then
54-
printf "\033[91mError: Sketch %s compiled for different target\n\033[0m\n" "$sketchname"
53+
local compiled_target
54+
compiled_target=$(grep -E "CONFIG_IDF_TARGET=" "$sdkconfig_path" | cut -d'"' -f2)
55+
if [ "$compiled_target" != "$target" ]; then
56+
printf "\033[91mError: Sketch %s compiled for %s, expected %s\033[0m\n" "$sketchname" "$compiled_target" "$target"
5557
printf "\n\n\n"
5658
return 1
5759
fi
5860

5961
if [ "$len" -eq 1 ]; then
6062
# build_dir="$sketchdir/build"
61-
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
63+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build.tmp"
6264
report_file="$sketchdir/$target/$sketchname.xml"
6365
fi
6466

@@ -81,7 +83,7 @@ function run_test {
8183

8284
if [ "$len" -ne 1 ]; then
8385
# build_dir="$sketchdir/build$i"
84-
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
86+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build$i.tmp"
8587
report_file="$sketchdir/$target/$sketchname$i.xml"
8688
fi
8789

@@ -113,14 +115,14 @@ function run_test {
113115
rm "$sketchdir"/diagram.json 2>/dev/null || true
114116

115117
result=0
116-
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "${extra_args[*]@Q}"
117-
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" ${extra_args[*]@Q}; exit \$?" || result=$?
118+
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "$test_type" "$platform" "$target" "$sketchname" "$i" "${extra_args[*]@Q}"
119+
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" -o junit_suite_name=${test_type}_${platform}_${target}_${sketchname}${i} ${extra_args[*]@Q}; exit \$?" || result=$?
118120
printf "\n"
119121
if [ $result -ne 0 ]; then
120122
result=0
121123
printf "\033[95mRetrying test: %s -- Config: %s\033[0m\n" "$sketchname" "$i"
122-
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "${extra_args[*]@Q}"
123-
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" ${extra_args[*]@Q}; exit \$?" || result=$?
124+
printf "\033[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s\033[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "$test_type" "$platform" "$target" "$sketchname" "$i" "${extra_args[*]@Q}"
125+
bash -c "set +e; pytest \"$sketchdir/test_$sketchname.py\" --build-dir \"$build_dir\" --junit-xml=\"$report_file\" -o junit_suite_name=${test_type}_${platform}_${target}_${sketchname}${i} ${extra_args[*]@Q}; exit \$?" || result=$?
124126
printf "\n"
125127
if [ $result -ne 0 ]; then
126128
printf "\033[91mFailed test: %s -- Config: %s\033[0m\n\n" "$sketchname" "$i"

.github/workflows/build_py_tools.yml

+13-17
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
find-changed-tools:
1414
name: Check if tools have been changed
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-latest
1616
outputs:
1717
any_changed: ${{ steps.verify-changed-files.outputs.any_changed }}
1818
all_changed_files: ${{ steps.verify-changed-files.outputs.all_changed_files }}
@@ -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: |
@@ -55,7 +55,7 @@ jobs:
5555
strategy:
5656
fail-fast: false
5757
matrix:
58-
os: [windows-latest, macos-latest, ubuntu-20.04, ARM]
58+
os: [windows-latest, macos-latest, ubuntu-latest, ubuntu-24.04-arm]
5959
include:
6060
- os: windows-latest
6161
TARGET: win64
@@ -64,14 +64,12 @@ jobs:
6464
- os: macos-latest
6565
TARGET: macos
6666
SEPARATOR: ":"
67-
- os: ubuntu-20.04
67+
- os: ubuntu-latest
6868
TARGET: linux-amd64
6969
SEPARATOR: ":"
70-
- os: ARM
71-
CONTAINER: python:3.8-bullseye
70+
- os: ubuntu-24.04-arm
7271
TARGET: arm
7372
SEPARATOR: ":"
74-
container: ${{ matrix.CONTAINER }} # use python container on ARM
7573
env:
7674
DISTPATH: pytools-${{ matrix.TARGET }}
7775
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi"
@@ -96,8 +94,6 @@ jobs:
9694
token: ${{ secrets.TOOLS_UPLOAD_PAT }}
9795
ref: ${{ github.event.pull_request.head.ref }}
9896
- name: Set up Python 3.8
99-
# Skip setting python on ARM because of missing compatibility: https://github.com/actions/setup-python/issues/108
100-
if: matrix.os != 'ARM'
10197
uses: actions/setup-python@master
10298
with:
10399
python-version: 3.8

.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 }}

0 commit comments

Comments
 (0)