15
15
workflow_dispatch :
16
16
inputs :
17
17
idf_branch :
18
- # This input can be an escaped JSON list of strings e.g. [\ "release/v5.1\"] or "all" to build all branches.
18
+ # This input can be a comma-separated list of strings ( e.g. "release/v5.1,release/v5.3") or "all" to build all branches.
19
19
# For IDF versions before v5.1, "all" is not supported. Use a specific branch instead.
20
20
description : ' IDF branch to build (check workflow file for instructions on how to use this input)'
21
21
required : true
22
22
default : ' all'
23
23
target :
24
- # This input can be an escaped JSON list of strings e.g. [\ "esp32\", \" esp32s2\"] or "all" to build all targets.
24
+ # This input can be a comma-separated list of strings ( e.g. "esp32, esp32s2") or "all" to build all targets.
25
25
# For IDF versions before v5.1, "all" is not supported. Use a specific target list instead.
26
26
description : ' Target to build (check workflow file for instructions on how to use this input)'
27
27
required : true
@@ -39,53 +39,11 @@ jobs:
39
39
matrix : ${{ steps.gen-matrix.outputs.matrix }}
40
40
branches : ${{ steps.gen-matrix.outputs.branches }}
41
41
steps :
42
+ - uses : actions/checkout@v4
42
43
- name : Generate matrix
43
44
id : gen-matrix
44
45
run : |
45
- # Change this based on the IDF branches we want to build
46
- all_branches="[\"release/v5.1\"]"
47
-
48
- # Change this based on the COMMON targets for all branches we want to build.
49
- common_targets="[\"esp32\", \"esp32s2\", \"esp32s3\", \"esp32c2\", \"esp32c3\", \"esp32c6\", \"esp32h2\"]"
50
-
51
- # For additional targets per branch, add them here
52
- additional_targets="[{\"idf_branch\": \"release/v5.3\", \"target\": \"esp32p4\"}]"
53
-
54
- branches="${{ github.event.inputs.idf_branch }}"
55
- targets="${{ github.event.inputs.target }}"
56
-
57
- if [ -z "$branches" ] || [ "$branches" == "all" ]; then
58
- branches=$all_branches
59
- fi
60
-
61
- if [ -z "$targets" ]; then
62
- targets="all"
63
- fi
64
-
65
- echo "Inputs:"
66
- echo "idf_branch: ${{ github.event.inputs.idf_branch }}"
67
- echo "target: ${{ github.event.inputs.target }}"
68
-
69
- matrix="{"
70
- matrix+="\"idf_branch\": $branches,"
71
-
72
- if [ "$targets" == "all" ]; then
73
- matrix+="\"target\": $common_targets,"
74
- matrix+="\"include\": "
75
- # Add all additional targets that are in the selected branches
76
- matrix+=$(echo $additional_targets | jq --argjson branches "$branches" '[.[] | select(.idf_branch as $branch | $branches | index($branch))]')
77
- else
78
- matrix+="\"target\": $targets"
79
- fi
80
-
81
- matrix+="}"
82
-
83
- echo "Branches: $branches"
84
- echo "Targets: $targets"
85
- echo "Matrix:"
86
- echo "$matrix" | jq .
87
- echo "matrix=$matrix" >> $GITHUB_OUTPUT
88
- echo "branches=$branches" >> $GITHUB_OUTPUT
46
+ bash ./tools/cron-gen-matrix.sh "${{ github.event.inputs.idf_branch }}" "${{ github.event.inputs.target }}"
89
47
90
48
build-libs :
91
49
name : Build with IDF ${{ matrix.idf_branch }} for ${{ matrix.target }}
0 commit comments