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 dcb7e40

Browse files
ci(component): Enable ESP32-C5 for component testing
1 parent 5611368 commit dcb7e40

File tree

2 files changed

+69
-30
lines changed

2 files changed

+69
-30
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ for example in $idf_component_examples; do
2020
fi
2121
fi
2222

23-
idf.py -C "$example" set-target "$IDF_TARGET"
23+
idf.py --preview -C "$example" set-target "$IDF_TARGET"
2424

2525
has_requirements=$(${CHECK_REQUIREMENTS} "$example" "$example/sdkconfig")
2626
if [ "$has_requirements" -eq 0 ]; then
@@ -29,5 +29,5 @@ for example in $idf_component_examples; do
2929
fi
3030

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

‎.github/workflows/build_component.yml

Lines changed: 67 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
description: "IDF Targets"
1313
default: "esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32c6,esp32h2,esp32p4"
1414
type: "string"
15-
required: true
15+
required: false
1616
push:
1717
branches:
1818
- master
@@ -66,49 +66,88 @@ jobs:
6666
runs-on: ubuntu-latest
6767
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'release/')) }}
6868
outputs:
69-
idf_ver: ${{ steps.set-matrix.outputs.idf_ver }}
70-
idf_target: ${{ steps.set-matrix.outputs.idf_target }}
69+
matrix: ${{ steps.set-matrix.outputs.matrix }}
7170
steps:
72-
- name: Get IDF Version and Targets
71+
- name: Get Matrix Combinations
7372
id: set-matrix
7473
run: |
75-
# Default values
76-
idf_ver="release-v5.3,release-v5.4,release-v5.5"
77-
idf_targets="esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32c6,esp32h2,esp32p4"
74+
# Define version-specific target configurations
75+
get_targets_for_version() {
76+
case "1ドル" in
77+
"release-v5.3")
78+
echo "esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32c6,esp32h2,esp32p4"
79+
;;
80+
"release-v5.4")
81+
echo "esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32c6,esp32h2,esp32p4"
82+
;;
83+
"release-v5.5")
84+
echo "esp32,esp32s2,esp32s3,esp32c2,esp32c3,esp32c5,esp32c6,esp32h2,esp32p4"
85+
;;
86+
*)
87+
echo ""
88+
;;
89+
esac
90+
}
91+
92+
# Default versions if not provided via inputs
93+
DEFAULT_VERSIONS="release-v5.3,release-v5.4,release-v5.5"
7894
79-
# Override with inputs if provided
95+
# Use inputs if provided, otherwise use defaults
8096
if [[ -n "${{ inputs.idf_ver }}" ]]; then
81-
idf_ver="${{ inputs.idf_ver }}"
82-
fi
83-
if [[ -n "${{ inputs.idf_targets }}" ]]; then
84-
idf_targets="${{ inputs.idf_targets }}"
97+
VERSIONS="${{ inputs.idf_ver }}"
98+
else
99+
VERSIONS="$DEFAULT_VERSIONS"
85100
fi
86101
87-
# Convert comma-separated strings to JSON arrays using a more robust method
88-
idf_ver_json=$(printf '%s\n' "$idf_ver" | tr ',' '\n' | jq -R . | jq -s . | jq -c .)
89-
idf_targets_json=$(printf '%s\n' "$idf_targets" | tr ',' '\n' | jq -R . | jq -s . | jq -c .)
102+
# Generate matrix combinations
103+
echo '{"include": [' > matrix.json
104+
first=true
105+
IFS=',' read -ra VERSION_ARRAY <<< "$VERSIONS"
106+
107+
for version in "${VERSION_ARRAY[@]}"; do
108+
# Trim whitespace
109+
version=$(echo "$version" | xargs)
110+
111+
# Get targets for this version
112+
if [[ -n "${{ inputs.idf_targets }}" ]]; then
113+
# Use provided targets for all versions
114+
targets="${{ inputs.idf_targets }}"
115+
else
116+
# Use version-specific targets
117+
targets=$(get_targets_for_version "$version")
118+
fi
119+
120+
if [[ -n "$targets" ]]; then
121+
IFS=',' read -ra TARGET_ARRAY <<< "$targets"
122+
for target in "${TARGET_ARRAY[@]}"; do
123+
# Trim whitespace
124+
target=$(echo "$target" | xargs)
125+
126+
if [ "$first" = true ]; then
127+
first=false
128+
else
129+
echo ',' >> matrix.json
130+
fi
131+
echo "{\"idf_ver\": \"$version\", \"idf_target\": \"$target\"}" >> matrix.json
132+
done
133+
fi
134+
done
135+
echo ']}' >> matrix.json
90136
91-
# Debug: Print the JSON for verification
92-
echo "Debug - idf_ver_json: $idf_ver_json"
93-
echo "Debug - idf_targets_json: $idf_targets_json"
137+
# Debug: Print the matrix for verification
138+
echo "Debug - Generated matrix:"
139+
cat matrix.json | jq .
94140
95-
# Set outputs - ensure no extra whitespace
96-
printf "idf_ver=%s\n" "$idf_ver_json" >> $GITHUB_OUTPUT
97-
printf "idf_target=%s\n" "$idf_targets_json" >> $GITHUB_OUTPUT
141+
# Set output
142+
printf "matrix=%s\n" "$(cat matrix.json | jq -c .)" >> $GITHUB_OUTPUT
98143
99144
build-esp-idf-component:
100145
name: Build IDF ${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
101146
runs-on: ubuntu-latest
102147
needs: set-matrix
103148
strategy:
104149
fail-fast: false
105-
matrix:
106-
# The version names here correspond to the versions of espressif/idf Docker image.
107-
# See https://hub.docker.com/r/espressif/idf/tags and
108-
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html
109-
# for details.
110-
idf_ver: ${{ fromJson(needs.set-matrix.outputs.idf_ver) }}
111-
idf_target: ${{ fromJson(needs.set-matrix.outputs.idf_target) }}
150+
matrix: ${{ fromJson(needs.set-matrix.outputs.matrix) }}
112151
container: espressif/idf:${{ matrix.idf_ver }}
113152
steps:
114153
- name: Check out arduino-esp32 as a component

0 commit comments

Comments
(0)

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