Skip to content

Commit 3260761

Browse files
authored
Merge branch 'espressif:master' into master
2 parents d9f0be0 + 543fad2 commit 3260761

File tree

34 files changed

+495
-385
lines changed

34 files changed

+495
-385
lines changed

.github/ISSUE_TEMPLATE/Feature-request.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ body:
55
- type: markdown
66
attributes:
77
value: |
8+
* Please note that we can only process feature requests reported in English to ensure effective communication and support. Feature requests written in other languages will be closed, with a request to rewrite them in English.
89
* We welcome any ideas or feature requests! It is helpful if you can explain exactly why the feature would be useful.
910
* There are usually some outstanding feature requests in the [existing issues list](https://github.com/espressif/arduino-esp32/issues?q=is%3Aopen+is%3Aissue+label%3A%22Type%3A+Feature+request%22), feel free to add comments to them.
1011
* If you would like to contribute, please read the [contributions guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html).

.github/ISSUE_TEMPLATE/Issue-report.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ body:
55
- type: markdown
66
attributes:
77
value: |
8+
* Please note that we can only process issues reported in English to ensure effective communication and support. Issues written in other languages will be closed, with a request to rewrite them in English.
89
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
910
* Please check [Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/index.html)
1011
* Take a look on [Troubleshooting guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html)

.github/scripts/on-push-idf.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
CHECK_REQUIREMENTS="./components/arduino-esp32/.github/scripts/sketch_utils.sh check_requirements"
6+
7+
# Export IDF environment
8+
. ${IDF_PATH}/export.sh
9+
10+
# Find all examples in ./components/arduino-esp32/idf_component_examples
11+
idf_component_examples=$(find ./components/arduino-esp32/idf_component_examples -mindepth 1 -maxdepth 1 -type d)
12+
13+
for example in $idf_component_examples; do
14+
if [ -f "$example"/ci.json ]; then
15+
# If the target is listed as false, skip the sketch. Otherwise, include it.
16+
is_target=$(jq -r --arg target "$IDF_TARGET" '.targets[$target]' "$example"/ci.json)
17+
if [[ "$is_target" == "false" ]]; then
18+
printf "\n\033[93mSkipping %s for target %s\033[0m\n\n" "$example" "$IDF_TARGET"
19+
continue
20+
fi
21+
fi
22+
23+
idf.py -C "$example" set-target "$IDF_TARGET"
24+
25+
has_requirements=$(${CHECK_REQUIREMENTS} "$example" "$example/sdkconfig")
26+
if [ "$has_requirements" -eq 0 ]; then
27+
printf "\n\033[93m%s does not meet the requirements for %s. Skipping...\033[0m\n\n" "$example" "$IDF_TARGET"
28+
continue
29+
fi
30+
31+
printf "\n\033[95mBuilding %s\033[0m\n\n" "$example"
32+
idf.py -C "$example" -DEXTRA_COMPONENT_DIRS="$PWD/components" build
33+
done

.github/scripts/on-release.sh

+14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ PACKAGE_JSON_MERGE="$GITHUB_WORKSPACE/.github/scripts/merge_packages.py"
3535
PACKAGE_JSON_TEMPLATE="$GITHUB_WORKSPACE/package/package_esp32_index.template.json"
3636
PACKAGE_JSON_DEV="package_esp32_dev_index.json"
3737
PACKAGE_JSON_REL="package_esp32_index.json"
38+
PACKAGE_JSON_DEV_CN="package_esp32_dev_index_cn.json"
39+
PACKAGE_JSON_REL_CN="package_esp32_index_cn.json"
3840

3941
echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF"
4042
echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID"
@@ -339,9 +341,13 @@ jq_arg=".packages[0].platforms[0].version = \"$RELEASE_TAG\" | \
339341
# Generate package JSONs
340342
echo "Generating $PACKAGE_JSON_DEV ..."
341343
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV"
344+
# On MacOS the sed command won't skip the first match. Use gsed instead.
345+
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_DEV" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
342346
if [ "$RELEASE_PRE" == "false" ]; then
343347
echo "Generating $PACKAGE_JSON_REL ..."
344348
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_REL"
349+
# On MacOS the sed command won't skip the first match. Use gsed instead.
350+
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_REL" > "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
345351
fi
346352

347353
# Figure out the last release or pre-release
@@ -373,12 +379,14 @@ echo
373379
if [ -n "$prev_any_release" ] && [ "$prev_any_release" != "null" ]; then
374380
echo "Merging with JSON from $prev_any_release ..."
375381
merge_package_json "$prev_any_release/$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV"
382+
merge_package_json "$prev_any_release/$PACKAGE_JSON_DEV_CN" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
376383
fi
377384

378385
if [ "$RELEASE_PRE" == "false" ]; then
379386
if [ -n "$prev_release" ] && [ "$prev_release" != "null" ]; then
380387
echo "Merging with JSON from $prev_release ..."
381388
merge_package_json "$prev_release/$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL"
389+
merge_package_json "$prev_release/$PACKAGE_JSON_REL_CN" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
382390
fi
383391
fi
384392

@@ -388,6 +396,8 @@ echo "Installing arduino-cli ..."
388396
export PATH="/home/runner/bin:$PATH"
389397
source "${SCRIPTS_DIR}/install-arduino-cli.sh"
390398

399+
# For the Chinese mirror, we can't test the package JSONs as the Chinese mirror might not be updated yet.
400+
391401
echo "Testing $PACKAGE_JSON_DEV install ..."
392402

393403
echo "Installing esp32 ..."
@@ -445,11 +455,15 @@ fi
445455
echo "Uploading $PACKAGE_JSON_DEV ..."
446456
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
447457
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
458+
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
459+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
448460
echo
449461
if [ "$RELEASE_PRE" == "false" ]; then
450462
echo "Uploading $PACKAGE_JSON_REL ..."
451463
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
452464
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
465+
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
466+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
453467
echo
454468
fi
455469

.github/scripts/sketch_utils.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function check_requirements { # check_requirements <sketchdir> <sdkconfig_path>
1616
local requirements_or
1717

1818
if [ ! -f "$sdkconfig_path" ] || [ ! -f "$sketchdir/ci.json" ]; then
19-
echo "ERROR: sdkconfig or ci.json not found" 1>&2
19+
echo "WARNING: sdkconfig or ci.json not found. Assuming requirements are met." 1>&2
2020
# Return 1 on error to force the sketch to be built and fail. This way the
2121
# CI will fail and the user will know that the sketch has a problem.
2222
else

.github/workflows/push.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ on:
3131
- "!libraries/**.properties"
3232
- "!libraries/**.py"
3333
- "package/**"
34+
- "idf_component_examples/**"
3435
- "tools/**.py"
3536
- "platform.txt"
3637
- "programmers.txt"
@@ -45,7 +46,6 @@ on:
4546
- "!.github/scripts/tests_*"
4647
- "!.github/scripts/upload_*"
4748
- "variants/esp32/**/*"
48-
- "variants/esp32c2/**/*"
4949
- "variants/esp32c3/**/*"
5050
- "variants/esp32c6/**/*"
5151
- "variants/esp32h2/**/*"
@@ -124,7 +124,7 @@ jobs:
124124
- 'idf_component.yml'
125125
- 'Kconfig.projbuild'
126126
- 'CMakeLists.txt'
127-
- "variants/esp32c2/**/*"
127+
- "idf_component_examples/**"
128128
129129
- name: Set chunks
130130
id: set-chunks
@@ -267,15 +267,23 @@ jobs:
267267
submodules: recursive
268268
path: components/arduino-esp32
269269

270+
- name: Setup jq
271+
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
272+
270273
- name: Build
271274
env:
272275
IDF_TARGET: ${{ matrix.idf_target }}
273276
shell: bash
274277
run: |
275-
. ${IDF_PATH}/export.sh
276-
idf.py create-project test
277-
echo CONFIG_FREERTOS_HZ=1000 > test/sdkconfig.defaults
278-
idf.py -C test -DEXTRA_COMPONENT_DIRS=$PWD/components build
278+
chmod a+x ./components/arduino-esp32/.github/scripts/*
279+
./components/arduino-esp32/.github/scripts/on-push-idf.sh
280+
281+
- name: Upload generated sdkconfig files for debugging
282+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
283+
if: always()
284+
with:
285+
name: sdkconfig-${{ matrix.idf_target }}
286+
path: ./components/arduino-esp32/idf_component_examples/**/sdkconfig
279287

280288
# Save artifacts to gh-pages
281289
save-master-artifacts:

0 commit comments

Comments
 (0)