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 9327fcb

Browse files
Merge branch 'master' into ci/esp32c5_component
2 parents dcb7e40 + f9bc177 commit 9327fcb

File tree

77 files changed

+1954
-246
lines changed

Some content is hidden

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

77 files changed

+1954
-246
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 --preview -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 --preview -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/workflows/build_component.yml

Lines changed: 55 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/**"
@@ -67,7 +67,53 @@ jobs:
6767
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'release/')) }}
6868
outputs:
6969
matrix: ${{ steps.set-matrix.outputs.matrix }}
70+
idf_ver: ${{ steps.set-matrix.outputs.idf_ver }}
71+
idf_target: ${{ steps.set-matrix.outputs.idf_target }}
72+
should_build: ${{ steps.affected-examples.outputs.should_build }}
7073
steps:
74+
- name: Install universal-ctags
75+
uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
76+
with:
77+
packages: libicu74 libjansson4 libxml2 libyaml-0-2 universal-ctags
78+
version: 1
79+
execute_install_scripts: true
80+
81+
- name: Checkout repository
82+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
83+
with:
84+
fetch-depth: 2
85+
86+
- name: Get changed files
87+
id: changed-files
88+
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
89+
90+
- name: Get affected examples
91+
id: affected-examples
92+
env:
93+
IS_PR: ${{ github.event_name == 'pull_request' }}
94+
run: |
95+
(which ctags-universal || which ctags) || (echo "Error: Neither ctags-universal nor ctags found in PATH" && exit 1)
96+
python3 ./.github/scripts/get_affected.py --debug --component ${{ steps.changed-files.outputs.all_changed_files }} > affected_examples.txt
97+
98+
- name: Upload affected examples
99+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
100+
with:
101+
name: affected_examples
102+
path: affected_examples.txt
103+
if-no-files-found: error
104+
105+
- name: Upload debug artifacts
106+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
107+
with:
108+
name: get_affected_debug
109+
path: |
110+
ctags_defs_by_qname.json
111+
ctags_header_to_qnames.json
112+
ctags_tags.jsonl
113+
dependencies.json
114+
dependencies_reverse.json
115+
if-no-files-found: warn
116+
71117
- name: Get Matrix Combinations
72118
id: set-matrix
73119
run: |
@@ -145,6 +191,7 @@ jobs:
145191
name: Build IDF ${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
146192
runs-on: ubuntu-latest
147193
needs: set-matrix
194+
if: ${{ needs.set-matrix.outputs.should_build == '1' }}
148195
strategy:
149196
fail-fast: false
150197
matrix: ${{ fromJson(needs.set-matrix.outputs.matrix) }}
@@ -160,13 +207,18 @@ jobs:
160207
- name: Setup jq
161208
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
162209

210+
- name: Download affected examples
211+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
212+
with:
213+
name: affected_examples
214+
163215
- name: Build
164216
env:
165217
IDF_TARGET: ${{ matrix.idf_target }}
166218
shell: bash
167219
run: |
168220
chmod a+x ./components/arduino-esp32/.github/scripts/*
169-
./components/arduino-esp32/.github/scripts/on-push-idf.sh
221+
./components/arduino-esp32/.github/scripts/on-push-idf.sh affected_examples.txt
170222
171223
- name: Upload generated sdkconfig files for debugging
172224
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 によって変換されたページ (->オリジナル) /