Skip to content

Commit 237814e

Browse files
authored
Merge branch 'master' into idf-release/v5.1
2 parents a8748cb + 462870d commit 237814e

File tree

111 files changed

+1756
-512
lines changed

Some content is hidden

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

111 files changed

+1756
-512
lines changed

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

+12-20
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ export ARDUINO_BUILD_DIR="$HOME/.arduino/build.tmp"
66

77
function build(){
88
local target=$1
9-
local fqbn=$2
10-
local chunk_index=$3
11-
local chunks_cnt=$4
12-
local build_log=$5
13-
local sketches_file=$6
14-
shift; shift; shift; shift; shift; shift;
9+
local chunk_index=$2
10+
local chunks_cnt=$3
11+
local build_log=$4
12+
local sketches_file=$5
13+
shift; shift; shift; shift; shift;
1514
local sketches=$*
1615

1716
local BUILD_SKETCH="${SCRIPTS_DIR}/sketch_utils.sh build"
1817
local BUILD_SKETCHES="${SCRIPTS_DIR}/sketch_utils.sh chunk_build"
1918

2019
local args="-ai $ARDUINO_IDE_PATH -au $ARDUINO_USR_PATH"
2120

22-
args+=" -t $target -fqbn $fqbn"
21+
args+=" -t $target"
2322

2423
if [ "$OS_IS_LINUX" == "1" ]; then
2524
args+=" -p $ARDUINO_ESP32_PATH/libraries"
@@ -77,13 +76,6 @@ if [ "$BUILD_PIO" -eq 0 ]; then
7776
source ${SCRIPTS_DIR}/install-arduino-cli.sh
7877
source ${SCRIPTS_DIR}/install-arduino-core-esp32.sh
7978

80-
FQBN_ESP32="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
81-
FQBN_ESP32S2="espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
82-
FQBN_ESP32S3="espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app"
83-
FQBN_ESP32C3="espressif:esp32:esp32c3:PartitionScheme=huge_app"
84-
FQBN_ESP32C6="espressif:esp32:esp32c6:PartitionScheme=huge_app"
85-
FQBN_ESP32H2="espressif:esp32:esp32h2:PartitionScheme=huge_app"
86-
8779
SKETCHES_ESP32="\
8880
$ARDUINO_ESP32_PATH/libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino\
8981
$ARDUINO_ESP32_PATH/libraries/BLE/examples/Server/Server.ino\
@@ -99,12 +91,12 @@ if [ "$BUILD_PIO" -eq 0 ]; then
9991
fi
10092

10193
#build sketches for different targets
102-
build "esp32s3" $FQBN_ESP32S3 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
103-
build "esp32s2" $FQBN_ESP32S2 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
104-
build "esp32c3" $FQBN_ESP32C3 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
105-
build "esp32c6" $FQBN_ESP32C6 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
106-
build "esp32h2" $FQBN_ESP32H2 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
107-
build "esp32" $FQBN_ESP32 "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
94+
build "esp32s3" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
95+
build "esp32s2" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
96+
build "esp32c3" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
97+
build "esp32c6" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
98+
build "esp32h2" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
99+
build "esp32" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
108100

109101
if [ "$BUILD_LOG" -eq 1 ]; then
110102
#remove last comma from the last JSON object

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

+2-8
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,9 @@ export PATH="/home/runner/bin:$PATH"
366366
source ./.github/scripts/install-arduino-cli.sh
367367

368368
echo "Testing $PACKAGE_JSON_DEV install ..."
369-
echo "Updating index ..."
370-
arduino-cli core update-index --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_DEV"
371-
if [ $? -ne 0 ]; then echo "ERROR: Failed to update index ($?)"; exit 1; fi
372369

373370
echo "Installing esp32 ..."
374-
arduino-cli core install esp32:esp32
371+
arduino-cli core install esp32:esp32 --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_DEV"
375372
if [ $? -ne 0 ]; then echo "ERROR: Failed to install esp32 ($?)"; exit 1; fi
376373

377374
echo "Compiling example ..."
@@ -386,12 +383,9 @@ echo "Test successful!"
386383

387384
if [ "$RELEASE_PRE" == "false" ]; then
388385
echo "Testing $PACKAGE_JSON_REL install ..."
389-
echo "Updating index ..."
390-
arduino-cli core update-index --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_REL"
391-
if [ $? -ne 0 ]; then echo "ERROR: Failed to update index ($?)"; exit 1; fi
392386

393387
echo "Installing esp32 ..."
394-
arduino-cli core install esp32:esp32
388+
arduino-cli core install esp32:esp32 --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_REL"
395389
if [ $? -ne 0 ]; then echo "ERROR: Failed to install esp32 ($?)"; exit 1; fi
396390

397391
echo "Compiling example ..."

Diff for: .github/scripts/sketch_utils.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,17 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
416416
echo "Start Sketch: $start_num"
417417
echo "End Sketch : $end_index"
418418

419+
#if fqbn is not passed then set it to default for compilation log
420+
if [ -z $fqbn ]; then
421+
log_fqbn="espressif:esp32:$target"
422+
else
423+
log_fqbn=$fqbn
424+
fi
425+
419426
sizes_file="$GITHUB_WORKSPACE/cli_compile_$chunk_index.json"
420427
if [ $log_compilation ]; then
421428
#echo board,target and start of sketches to sizes_file json
422-
echo "{ \"board\": \"$fqbn\",
429+
echo "{ \"board\": \"$log_fqbn\",
423430
\"target\": \"$target\",
424431
\"sketches\": [" >> "$sizes_file"
425432
fi

Diff for: .github/workflows/docs_deploy.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Documentation Build and Production Deploy CI
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_run:
5+
workflows: ["ESP32 Arduino Release"]
6+
types:
7+
- completed
68
push:
79
branches:
810
- release/v2.x
@@ -12,14 +14,18 @@ on:
1214
- '.github/workflows/docs_deploy.yml'
1315

1416
jobs:
15-
1617
deploy-prod-docs:
1718
name: Deploy Documentation on Production
1819
runs-on: ubuntu-22.04
1920
defaults:
2021
run:
2122
shell: bash
2223
steps:
24+
- name: Check if release workflow is successful
25+
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion != 'success' }}
26+
run: |
27+
echo "Release workflow failed. Exiting..."
28+
exit 1
2329
- uses: actions/checkout@v4
2430
with:
2531
submodules: true

Diff for: .github/workflows/tests_results.yml

+22-4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ jobs:
4141
original_sha=$(cat ./artifacts/parent-artifacts/sha.txt)
4242
original_ref=$(cat ./artifacts/parent-artifacts/ref.txt)
4343
original_conclusion=$(cat ./artifacts/parent-artifacts/conclusion.txt)
44+
45+
# Sanitize the values to avoid security issues
46+
47+
# Event: Allow alphabetical characters and underscores
48+
original_event=$(echo "$original_event" | tr -cd '[:alpha:]_')
49+
50+
# Action: Allow alphabetical characters and underscores
51+
original_action=$(echo "$original_action" | tr -cd '[:alpha:]_')
52+
53+
# SHA: Allow alphanumeric characters
54+
original_sha=$(echo "$original_sha" | tr -cd '[:alnum:]')
55+
56+
# Ref: Allow alphanumeric characters, slashes, underscores, dots, and dashes
57+
original_ref=$(echo "$original_ref" | tr -cd '[:alnum:]/_.-')
58+
59+
# Conclusion: Allow alphabetical characters and underscores
60+
original_conclusion=$(echo "$original_conclusion" | tr -cd '[:alpha:]_')
61+
4462
echo "original_event=$original_event" >> $GITHUB_ENV
4563
echo "original_action=$original_action" >> $GITHUB_ENV
4664
echo "original_sha=$original_sha" >> $GITHUB_ENV
@@ -71,10 +89,10 @@ jobs:
7189
uses: actions/github-script@v7
7290
with:
7391
script: |
74-
const ref = '${{ env.original_ref }}';
92+
const ref = process.env.original_ref;
7593
const key_prefix = 'tests-' + ref + '-';
7694
77-
if ('${{ env.original_event }}' == 'pull_request' && '${{ env.original_action }}' != 'closed') {
95+
if (process.env.original_event == 'pull_request' && process.env.original_action != 'closed') {
7896
console.log('Skipping cache cleanup for open PR');
7997
return;
8098
}
@@ -104,12 +122,12 @@ jobs:
104122
script: |
105123
const owner = '${{ github.repository_owner }}';
106124
const repo = '${{ github.repository }}'.split('/')[1];
107-
const sha = '${{ env.original_sha }}';
125+
const sha = process.env.original_sha;
108126
core.debug(`owner: ${owner}`);
109127
core.debug(`repo: ${repo}`);
110128
core.debug(`sha: ${sha}`);
111129
const { context: name, state } = (await github.rest.repos.createCommitStatus({
112-
context: 'Runtime Tests / Report results (${{ env.original_event }} -> workflow_run -> workflow_run)',
130+
context: `Runtime Tests / Report results (${process.env.original_event} -> workflow_run -> workflow_run)`,
113131
owner: owner,
114132
repo: repo,
115133
sha: sha,

Diff for: .github/workflows/upload-idf-component.yml

+34-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,42 @@
11
name: Push components to https://components.espressif.com
2+
23
on:
3-
push:
4-
tags:
5-
- '*'
4+
workflow_run:
5+
workflows: ["ESP32 Arduino Release"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
contents: read
11+
612
jobs:
713
upload_components:
814
runs-on: ubuntu-latest
915
steps:
16+
- name: Get the release tag
17+
env:
18+
head_branch: ${{ github.event.workflow_run.head_branch }}
19+
run: |
20+
if [ "${{ github.event.workflow_run.conclusion }}" != "success" ]; then
21+
echo "Release workflow failed. Exiting..."
22+
exit 1
23+
fi
24+
25+
# Read and sanitize the branch/tag name
26+
branch=$(echo "$head_branch" | tr -cd '[:alnum:]/_.-')
27+
28+
if [[ $branch == refs/tags/* ]]; then
29+
tag="${branch#refs/tags/}"
30+
elif [[ $branch =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
31+
tag=$branch
32+
else
33+
echo "Tag not found in $branch. Exiting..."
34+
exit 1
35+
fi
36+
37+
echo "Tag: $tag"
38+
echo "RELEASE_TAG=$tag" >> $GITHUB_ENV
39+
1040
- uses: actions/checkout@v4
1141
with:
1242
submodules: "recursive"
@@ -15,6 +45,6 @@ jobs:
1545
uses: espressif/upload-components-ci-action@v1
1646
with:
1747
name: arduino-esp32
18-
version: ${{ github.ref_name }}
48+
version: ${{ env.RELEASE_TAG }}
1949
namespace: espressif
2050
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}

Diff for: .pre-commit-config.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ repos:
2525
args: [--fix=lf]
2626
- id: trailing-whitespace
2727
args: [--markdown-linebreak-ext=md]
28+
- id: pretty-format-json
29+
args: [--autofix]
30+
types_or: [json]
31+
exclude: |
32+
(?x)(
33+
diagram\..*\.json$|
34+
package\.json$|
35+
^package\/.*$
36+
)
2837
- repo: https://github.com/codespell-project/codespell
2938
rev: "v2.3.0"
3039
hooks:

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ target_compile_options(${COMPONENT_TARGET} PUBLIC
320320
-DARDUINO_ARCH_ESP32
321321
-DARDUINO_BOARD="${idf_target_caps}_DEV"
322322
-DARDUINO_VARIANT="${CONFIG_ARDUINO_VARIANT}"
323-
-DESP32)
323+
-DESP32=ESP32)
324324

325325
if(CONFIG_AUTOSTART_ARDUINO)
326326
# in autostart mode, arduino-esp32 contains app_main() function and needs to

0 commit comments

Comments
 (0)