Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 03932c9

Browse files
Merge branch 'master' into idf-release/v5.5
2 parents 31b161b + adac4c2 commit 03932c9

File tree

94 files changed

+2141
-393
lines changed

Some content is hidden

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

94 files changed

+2141
-393
lines changed

‎.github/scripts/get_affected.py

Lines changed: 841 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,33 @@ CHECK_REQUIREMENTS="./components/arduino-esp32/.github/scripts/sketch_utils.sh c
77
# Export IDF environment
88
. ${IDF_PATH}/export.sh
99

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
10+
if [ -n "1ドル" ]; then
11+
# If a file is provided, use it to get the affected examples.
12+
affected_examples=$(cat "1ドル" | sort)
13+
else
14+
# Otherwise, find all examples in ./components/arduino-esp32/idf_component_examples
15+
affected_examples=$(find ./components/arduino-esp32/idf_component_examples -mindepth 1 -maxdepth 1 -type d | sed 's|^\./components/arduino-esp32/||' | sort)
16+
fi
17+
18+
for example in $affected_examples; do
19+
example_path="$PWD/components/arduino-esp32/$example"
20+
if [ -f "$example_path/ci.json" ]; then
1521
# 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)
22+
is_target=$(jq -r --arg target "$IDF_TARGET" '.targets[$target]' "$example_path/ci.json")
1723
if [[ "$is_target" == "false" ]]; then
1824
printf "\n033円[93mSkipping %s for target %s033円[0m\n\n" "$example" "$IDF_TARGET"
1925
continue
2026
fi
2127
fi
2228

23-
idf.py -C "$example" set-target "$IDF_TARGET"
29+
idf.py -C "$example_path" set-target "$IDF_TARGET"
2430

25-
has_requirements=$(${CHECK_REQUIREMENTS} "$example" "$example/sdkconfig")
31+
has_requirements=$(${CHECK_REQUIREMENTS} "$example_path" "$example_path/sdkconfig")
2632
if [ "$has_requirements" -eq 0 ]; then
2733
printf "\n033円[93m%s does not meet the requirements for %s. Skipping...033円[0m\n\n" "$example" "$IDF_TARGET"
2834
continue
2935
fi
3036

3137
printf "\n033円[95mBuilding %s033円[0m\n\n" "$example"
32-
idf.py -C "$example" -DEXTRA_COMPONENT_DIRS="$PWD/components" build
38+
idf.py -C "$example_path" -DEXTRA_COMPONENT_DIRS="$PWD/components" build
3339
done

‎.github/scripts/set_push_chunks.sh

Lines changed: 0 additions & 83 deletions
This file was deleted.

‎.github/scripts/sketch_utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
357357
unset options
358358
}
359359

360-
function count_sketches { # count_sketches <path> [target] [file] [ignore-requirements]
360+
function count_sketches { # count_sketches <path> [target] [ignore-requirements] [file]
361361
local path=1ドル
362362
local target=2ドル
363363
local ignore_requirements=3ドル
@@ -376,7 +376,7 @@ function count_sketches { # count_sketches <path> [target] [file] [ignore-requir
376376
fi
377377

378378
if [ -f "$file" ]; then
379-
sketches=$(cat "$file")
379+
sketches=$(cat "$file"| sort)
380380
else
381381
sketches=$(find "$path" -name '*.ino' | sort)
382382
fi

‎.github/scripts/tests_run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ function run_test {
115115
rm "$sketchdir"/diagram.json 2>/dev/null || true
116116

117117
result=0
118-
printf "033円[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s033円[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=$?
118+
printf "033円[95mpytest -s \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s033円[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "$test_type" "$platform" "$target" "$sketchname" "$i" "${extra_args[*]@Q}"
119+
bash -c "set +e; pytest -s \"$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=$?
120120
printf "\n"
121121
if [ $result -ne 0 ]; then
122122
result=0
123123
printf "033円[95mRetrying test: %s -- Config: %s033円[0m\n" "$sketchname" "$i"
124-
printf "033円[95mpytest \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s033円[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=$?
124+
printf "033円[95mpytest -s \"%s/test_%s.py\" --build-dir \"%s\" --junit-xml=\"%s\" -o junit_suite_name=%s_%s_%s_%s%s %s033円[0m\n" "$sketchdir" "$sketchname" "$build_dir" "$report_file" "$test_type" "$platform" "$target" "$sketchname" "$i" "${extra_args[*]@Q}"
125+
bash -c "set +e; pytest -s \"$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=$?
126126
printf "\n"
127127
if [ $result -ne 0 ]; then
128128
printf "033円[91mFailed test: %s -- Config: %s033円[0m\n\n" "$sketchname" "$i"

‎.github/workflows/build_component.yml

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ on:
2323
- "libraries/**/*.cpp"
2424
- "libraries/**/*.c"
2525
- "libraries/**/*.h"
26-
- "libraries/**/*.ino"
27-
- "libraries/**/ci.json"
2826
- "idf_component_examples/**"
2927
- "idf_component.yml"
3028
- "Kconfig.projbuild"
@@ -33,9 +31,11 @@ on:
3331
- ".github/scripts/check-cmakelists.sh"
3432
- ".github/scripts/on-push-idf.sh"
3533
- ".github/scripts/sketch_utils.sh"
34+
- ".github/scripts/get_affected.py"
3635
- "variants/esp32/**"
3736
- "variants/esp32c2/**"
3837
- "variants/esp32c3/**"
38+
- "variants/esp32c5/**"
3939
- "variants/esp32c6/**"
4040
- "variants/esp32h2/**"
4141
- "variants/esp32p4/**"
@@ -68,7 +68,51 @@ jobs:
6868
outputs:
6969
idf_ver: ${{ steps.set-matrix.outputs.idf_ver }}
7070
idf_target: ${{ steps.set-matrix.outputs.idf_target }}
71+
should_build: ${{ steps.affected-examples.outputs.should_build }}
7172
steps:
73+
- name: Install universal-ctags
74+
uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
75+
with:
76+
packages: libicu74 libjansson4 libxml2 libyaml-0-2 universal-ctags
77+
version: 1
78+
execute_install_scripts: true
79+
80+
- name: Checkout repository
81+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82+
with:
83+
fetch-depth: 2
84+
85+
- name: Get changed files
86+
id: changed-files
87+
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
88+
89+
- name: Get affected examples
90+
id: affected-examples
91+
env:
92+
IS_PR: ${{ github.event_name == 'pull_request' }}
93+
run: |
94+
(which ctags-universal || which ctags) || (echo "Error: Neither ctags-universal nor ctags found in PATH" && exit 1)
95+
python3 ./.github/scripts/get_affected.py --debug --component ${{ steps.changed-files.outputs.all_changed_files }} > affected_examples.txt
96+
97+
- name: Upload affected examples
98+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
99+
with:
100+
name: affected_examples
101+
path: affected_examples.txt
102+
if-no-files-found: error
103+
104+
- name: Upload debug artifacts
105+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
106+
with:
107+
name: get_affected_debug
108+
path: |
109+
ctags_defs_by_qname.json
110+
ctags_header_to_qnames.json
111+
ctags_tags.jsonl
112+
dependencies.json
113+
dependencies_reverse.json
114+
if-no-files-found: warn
115+
72116
- name: Get IDF Version and Targets
73117
id: set-matrix
74118
run: |
@@ -100,6 +144,7 @@ jobs:
100144
name: Build IDF ${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
101145
runs-on: ubuntu-latest
102146
needs: set-matrix
147+
if: ${{ needs.set-matrix.outputs.should_build == '1' }}
103148
strategy:
104149
fail-fast: false
105150
matrix:
@@ -121,13 +166,18 @@ jobs:
121166
- name: Setup jq
122167
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
123168

169+
- name: Download affected examples
170+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
171+
with:
172+
name: affected_examples
173+
124174
- name: Build
125175
env:
126176
IDF_TARGET: ${{ matrix.idf_target }}
127177
shell: bash
128178
run: |
129179
chmod a+x ./components/arduino-esp32/.github/scripts/*
130-
./components/arduino-esp32/.github/scripts/on-push-idf.sh
180+
./components/arduino-esp32/.github/scripts/on-push-idf.sh affected_examples.txt
131181
132182
- name: Upload generated sdkconfig files for debugging
133183
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

‎.github/workflows/pre-commit.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
permissions:
16-
contents: write
17-
pull-requests: read
16+
contents: read
17+
pull-requests: write
1818

1919
jobs:
2020
lint:
@@ -34,6 +34,7 @@ jobs:
3434
- name: Remove Label
3535
if: contains(github.event.pull_request.labels.*.name, 'Re-trigger Pre-commit Hooks')
3636
run: gh pr edit ${{ github.event.number }} --remove-label 'Re-trigger Pre-commit Hooks'
37+
continue-on-error: true
3738
env:
3839
GH_TOKEN: ${{ github.token }}
3940

@@ -65,6 +66,7 @@ jobs:
6566
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
6667

6768
- name: Run pre-commit hooks in changed files
69+
id: pre-commit
6870
run: pre-commit run --color=always --show-diff-on-failure --files ${{ steps.changed-files.outputs.all_changed_files }}
6971

7072
- name: Save pre-commit cache
@@ -82,3 +84,20 @@ jobs:
8284
if: ${{ always() && github.event_name == 'pull_request' }}
8385
with:
8486
msg: "ci(pre-commit): Apply automatic fixes"
87+
88+
- name: Add label if no commits are pending
89+
if: ${{ failure() && steps.pre-commit.outcome == 'failure' && steps.pre-commit.outputs.pending_commit == '0' && github.event_name == 'pull_request' }}
90+
continue-on-error: true
91+
run: |
92+
gh pr edit ${{ github.event.number }} --add-label 'Status: Pre-commit fixes required ⚠️'
93+
env:
94+
GH_TOKEN: ${{ github.token }}
95+
96+
- name: Remove label if everything was fixed
97+
if: ${{ success() && github.event_name == 'pull_request' }}
98+
continue-on-error: true
99+
run: |
100+
gh pr edit ${{ github.event.number }} --remove-label 'Status: Pre-commit fixes required ⚠️'
101+
env:
102+
GH_TOKEN: ${{ github.token }}
103+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /