Skip to content

Commit dc8e81d

Browse files
authored
Merge branch 'master' into release/v3.0.x
2 parents 3bfa3e0 + eeecf84 commit dc8e81d

File tree

30 files changed

+2937
-326
lines changed

30 files changed

+2937
-326
lines changed

.github/scripts/find_new_boards.sh

+16-15
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@
22

33
# Get inputs from command
44
owner_repository=$1
5-
pr_number=$2
5+
base_ref=$2
66

7-
url="https://api.github.com/repos/$owner_repository/pulls/$pr_number/files"
8-
echo $url
7+
# Download the boards.txt file from the base branch
8+
curl -L -o boards_base.txt https://raw.githubusercontent.com/$owner_repository/$base_ref/boards.txt
99

10-
# Get changes in boards.txt file from PR
11-
Boards_modified_url=$(curl -s $url | jq -r '.[] | select(.filename == "boards.txt") | .raw_url')
10+
# Compare boards.txt file in the repo with the modified file from PR
11+
diff=$(diff -u boards_base.txt boards.txt)
1212

13-
# Echo the modified boards.txt file URL
14-
echo "Modified boards.txt file URL:"
15-
echo $Boards_modified_url
16-
17-
# Download the modified boards.txt file
18-
curl -L -o boards_pr.txt $Boards_modified_url
19-
20-
# Compare boards.txt file in the repo with the modified file
21-
diff=$(diff -u boards.txt boards_pr.txt)
13+
# Check if the diff is empty
14+
if [ -z "$diff" ]
15+
then
16+
echo "No changes in boards.txt file"
17+
echo "FQBNS="
18+
exit 0
19+
fi
2220

2321
# Extract added or modified lines (lines starting with '+' or '-')
2422
modified_lines=$(echo "$diff" | grep -E '^[+-][^+-]')
2523

24+
# Print the modified lines for debugging
25+
echo "Modified lines:"
26+
echo "$modified_lines"
27+
2628
boards_array=()
2729
previous_board=""
28-
file="boards.txt"
2930

3031
# Extract board names from the modified lines, and add them to the boards_array
3132
while read -r line

.github/scripts/set_push_chunks.sh

+58-58
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,73 @@ build_all=false
44
chunks_count=0
55

66
if [[ $CORE_CHANGED == 'true' ]] || [[ $IS_PR != 'true' ]]; then
7-
echo "Core files changed or not a PR. Building all."
8-
build_all=true
9-
chunks_count=$MAX_CHUNKS
7+
echo "Core files changed or not a PR. Building all."
8+
build_all=true
9+
chunks_count=$MAX_CHUNKS
1010
elif [[ $LIB_CHANGED == 'true' ]]; then
11-
echo "Libraries changed. Building only affected sketches."
12-
if [[ $NETWORKING_CHANGED == 'true' ]]; then
13-
echo "Networking libraries changed. Building networking related sketches."
14-
networking_sketches="$(find libraries/WiFi -name *.ino) "
15-
networking_sketches+="$(find libraries/Ethernet -name *.ino) "
16-
networking_sketches+="$(find libraries/PPP -name *.ino) "
17-
networking_sketches+="$(find libraries/NetworkClientSecure -name *.ino) "
18-
networking_sketches+="$(find libraries/WebServer -name *.ino) "
19-
fi
20-
if [[ $FS_CHANGED == 'true' ]]; then
21-
echo "FS libraries changed. Building FS related sketches."
22-
fs_sketches="$(find libraries/SD -name *.ino) "
23-
fs_sketches+="$(find libraries/SD_MMC -name *.ino) "
24-
fs_sketches+="$(find libraries/SPIFFS -name *.ino) "
25-
fs_sketches+="$(find libraries/LittleFS -name *.ino) "
26-
fs_sketches+="$(find libraries/FFat -name *.ino) "
27-
fi
28-
sketches="$networking_sketches $fs_sketches"
29-
for file in $LIB_FILES; do
30-
if [[ $file == *.ino ]]; then
31-
# If file ends with .ino, add it to the list of sketches
32-
echo "Sketch found: $file"
33-
sketches+="$file "
34-
elif [[ $(basename $(dirname $file)) == "src" ]]; then
35-
# If file is in a src directory, find all sketches in the parent/examples directory
36-
echo "Library src file found: $file"
37-
lib=$(dirname $(dirname $file))
38-
if [[ -d $lib/examples ]]; then
39-
lib_sketches=$(find $lib/examples -name *.ino)
40-
sketches+="$lib_sketches "
41-
echo "Library sketches: $lib_sketches"
42-
fi
43-
else
44-
# If file is in a example folder but it is not a sketch, find all sketches in the current directory
45-
echo "File in example folder found: $file"
46-
sketch=$(find $(dirname $file) -name *.ino)
47-
sketches+="$sketch "
48-
echo "Sketch in example folder: $sketch"
49-
fi
50-
echo ""
51-
done
11+
echo "Libraries changed. Building only affected sketches."
12+
if [[ $NETWORKING_CHANGED == 'true' ]]; then
13+
echo "Networking libraries changed. Building networking related sketches."
14+
networking_sketches="$(find libraries/WiFi -name *.ino) "
15+
networking_sketches+="$(find libraries/Ethernet -name *.ino) "
16+
networking_sketches+="$(find libraries/PPP -name *.ino) "
17+
networking_sketches+="$(find libraries/NetworkClientSecure -name *.ino) "
18+
networking_sketches+="$(find libraries/WebServer -name *.ino) "
19+
fi
20+
if [[ $FS_CHANGED == 'true' ]]; then
21+
echo "FS libraries changed. Building FS related sketches."
22+
fs_sketches="$(find libraries/SD -name *.ino) "
23+
fs_sketches+="$(find libraries/SD_MMC -name *.ino) "
24+
fs_sketches+="$(find libraries/SPIFFS -name *.ino) "
25+
fs_sketches+="$(find libraries/LittleFS -name *.ino) "
26+
fs_sketches+="$(find libraries/FFat -name *.ino) "
27+
fi
28+
sketches="$networking_sketches $fs_sketches"
29+
for file in $LIB_FILES; do
30+
lib=$(echo $file | awk -F "/" '{print $1"/"$2}')
31+
if [[ "$file" == *.ino ]]; then
32+
# If file ends with .ino, add it to the list of sketches
33+
echo "Sketch found: $file"
34+
sketches+="$file "
35+
elif [[ "$file" == "$lib/src/"* ]]; then
36+
# If file is inside the src directory, find all sketches in the lib/examples directory
37+
echo "Library src file found: $file"
38+
if [[ -d $lib/examples ]]; then
39+
lib_sketches=$(find $lib/examples -name *.ino)
40+
sketches+="$lib_sketches "
41+
echo "Library sketches: $lib_sketches"
42+
fi
43+
else
44+
# If file is in a example folder but it is not a sketch, find all sketches in the current directory
45+
echo "File in example folder found: $file"
46+
sketch=$(find $(dirname $file) -name *.ino)
47+
sketches+="$sketch "
48+
echo "Sketch in example folder: $sketch"
49+
fi
50+
echo ""
51+
done
5252
fi
5353

5454
if [[ -n $sketches ]]; then
55-
# Remove duplicates
56-
sketches=$(echo $sketches | tr ' ' '\n' | sort | uniq)
57-
for sketch in $sketches; do
58-
echo $sketch >> sketches_found.txt
59-
chunks_count=$((chunks_count+1))
60-
done
61-
echo "Number of sketches found: $chunks_count"
62-
echo "Sketches:"
63-
echo "$sketches"
55+
# Remove duplicates
56+
sketches=$(echo $sketches | tr ' ' '\n' | sort | uniq)
57+
for sketch in $sketches; do
58+
echo $sketch >> sketches_found.txt
59+
chunks_count=$((chunks_count+1))
60+
done
61+
echo "Number of sketches found: $chunks_count"
62+
echo "Sketches:"
63+
echo "$sketches"
6464

65-
if [[ $chunks_count -gt $MAX_CHUNKS ]]; then
66-
echo "More sketches than the allowed number of chunks found. Limiting to $MAX_CHUNKS chunks."
67-
chunks_count=$MAX_CHUNKS
68-
fi
65+
if [[ $chunks_count -gt $MAX_CHUNKS ]]; then
66+
echo "More sketches than the allowed number of chunks found. Limiting to $MAX_CHUNKS chunks."
67+
chunks_count=$MAX_CHUNKS
68+
fi
6969
fi
7070

7171
chunks='["0"'
7272
for i in $(seq 1 $(( $chunks_count - 1 )) ); do
73-
chunks+=",\"$i\""
73+
chunks+=",\"$i\""
7474
done
7575
chunks+="]"
7676

.github/workflows/boards.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Get board name
3131
run:
32-
bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.event.number}}
32+
bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref}}
3333

3434
test-boards:
3535
needs: find-boards
@@ -42,6 +42,7 @@ jobs:
4242
name: "espressif:esp32"
4343
4444
strategy:
45+
fail-fast: false
4546
matrix: ${{ fromJson(needs.find-boards.outputs.fqbns) }}
4647

4748
steps:

.github/workflows/pre-commit.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
branches:
77
- master
88
pull_request:
9-
types: [opened, reopened, synchronize, labeled, unlabeled]
9+
types: [opened, reopened, synchronize, labeled]
1010

1111
concurrency:
1212
group: pre-commit-${{github.event.pull_request.number || github.ref}}
@@ -15,8 +15,10 @@ concurrency:
1515
jobs:
1616
lint:
1717
if: |
18+
github.event_name != 'pull_request' ||
1819
contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') ||
19-
github.event_name != 'pull_request'
20+
contains(github.event.pull_request.labels.*.name, 'Re-trigger Pre-commit Hooks')
21+
2022
name: Check if fixes are needed
2123
runs-on: ubuntu-latest
2224
steps:
@@ -25,6 +27,12 @@ jobs:
2527
with:
2628
fetch-depth: 2
2729

30+
- name: Remove Label
31+
if: contains(github.event.pull_request.labels.*.name, 'Re-trigger Pre-commit Hooks')
32+
run: gh pr edit ${{ github.event.number }} --remove-label 'Re-trigger Pre-commit Hooks'
33+
env:
34+
GH_TOKEN: ${{ github.token }}
35+
2836
- name: Set up Python 3
2937
uses: actions/setup-python@v5
3038
with:
@@ -65,7 +73,7 @@ jobs:
6573
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
6674

6775
- name: Push changes using pre-commit-ci-lite
68-
uses: pre-commit-ci/lite-action@v1.0.2
76+
uses: pre-commit-ci/lite-action@v1.1.0
6977
# Only push changes in PRs
7078
if: ${{ always() && github.event_name == 'pull_request' }}
7179
with:

.github/workflows/push.yml

+20-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
push:
66
branches:
77
- master
8-
- release/v2.x
8+
- release/*
99
pull_request:
1010
paths:
1111
- 'cores/**'
@@ -21,12 +21,20 @@ on:
2121
- 'idf_component.yml'
2222
- 'Kconfig.projbuild'
2323
- 'package.json'
24+
- 'CMakeLists.txt'
2425
- '.github/workflows/push.yml'
2526
- '.github/scripts/**'
2627
- '!.github/scripts/find_*'
2728
- '!.github/scripts/on-release.sh'
2829
- '!.github/scripts/tests_*'
2930
- '!.github/scripts/upload_*'
31+
- "variants/esp32/**/*"
32+
- "variants/esp32s2/**/*"
33+
- "variants/esp32s3/**/*"
34+
- "variants/esp32c2/**/*"
35+
- "variants/esp32c3/**/*"
36+
- "variants/esp32c6/**/*"
37+
- "variants/esp32h2/**/*"
3038

3139
concurrency:
3240
group: build-${{github.event.pull_request.number || github.ref}}
@@ -39,13 +47,15 @@ jobs:
3947
cmake-check:
4048
name: Check cmake file
4149
runs-on: ubuntu-latest
50+
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'release/')) }}
4251
steps:
4352
- uses: actions/checkout@v4
4453
- run: bash ./.github/scripts/check-cmakelists.sh
4554

4655
gen-chunks:
4756
name: Generate chunks
4857
runs-on: ubuntu-latest
58+
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'release/')) }}
4959
outputs:
5060
build_all: ${{ steps.set-chunks.outputs.build_all }}
5161
build_libraries: ${{ steps.set-chunks.outputs.build_libraries }}
@@ -74,6 +84,12 @@ jobs:
7484
- '!tools/platformio-build.py'
7585
- 'platform.txt'
7686
- 'programmers.txt'
87+
- "variants/esp32/**/*"
88+
- "variants/esp32s2/**/*"
89+
- "variants/esp32s3/**/*"
90+
- "variants/esp32c3/**/*"
91+
- "variants/esp32c6/**/*"
92+
- "variants/esp32h2/**/*"
7793
libraries:
7894
- 'libraries/**/examples/**'
7995
- 'libraries/**/src/**'
@@ -92,6 +108,8 @@ jobs:
92108
idf:
93109
- 'idf_component.yml'
94110
- 'Kconfig.projbuild'
111+
- 'CMakeLists.txt'
112+
- "variants/esp32c2/**/*"
95113
platformio:
96114
- 'package.json'
97115
- '.github/scripts/install-platformio-esp32.sh'
@@ -291,7 +309,7 @@ jobs:
291309
#Upload PR number as artifact
292310
upload-pr-number:
293311
name: Upload PR number
294-
if: github.event_name == 'pull_request'
312+
if: ${{ github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release/') }}
295313
runs-on: ubuntu-latest
296314
steps:
297315
- name: Save the PR number in an artifact

.github/workflows/tests.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ on:
2626
- '!.github/scripts/upload_py_tools.sh'
2727
- 'tests/**'
2828
- 'cores/**'
29-
- 'libraries/**'
30-
- '!libraries/**.md'
31-
- '!libraries/**.txt'
32-
- '!libraries/**.properties'
29+
- 'libraries/*/src/**.cpp'
30+
- 'libraries/*/src/**.h'
31+
- 'libraries/*/src/**.c'
3332
- 'package/**'
3433
schedule:
3534
- cron: '0 2 * * *'

0 commit comments

Comments
 (0)