Skip to content

Commit 52a50ea

Browse files
lupyuenxiaoxiang781216
authored andcommitted
CI: Split the Build Jobs for Arm64 and x86_64
This PR syncs apache/nuttx#14282 from `nuttx` repo to `nuttx-apps`.
1 parent 729cc33 commit 52a50ea

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.github/workflows/arch.yml

+17-11
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@ jobs:
4242
exit
4343
fi
4444
45+
# Ignore the Label "Area: Documentation", because it won't affect the Build Targets
46+
query='.labels | map(select(.name != "Area: Documentation")) | '
47+
select_name='.[].name'
48+
select_length='length'
49+
4550
# Get the Labels for the PR: "Arch: risc-v \n Board: risc-v \n Size: XS"
4651
# If GitHub CLI Fails: Build all targets
47-
labels=$(gh pr view $pr --repo $GITHUB_REPOSITORY --json labels --jq '.labels[] | .name' || echo "")
48-
numlabels=$(gh pr view $pr --repo $GITHUB_REPOSITORY --json labels --jq '.[] | length' || echo "")
52+
labels=$(gh pr view $pr --repo $GITHUB_REPOSITORY --json labels --jq "$query$select_name" || echo "")
53+
numlabels=$(gh pr view $pr --repo $GITHUB_REPOSITORY --json labels --jq "$query$select_length" || echo "")
54+
echo "labels=$labels"
4955
echo "numlabels=$numlabels" | tee -a $GITHUB_OUTPUT
5056
5157
# Identify the Size, Arch and Board Labels
@@ -190,37 +196,37 @@ jobs:
190196
191197
# For "Arch / Board: arm": Build arm-01, arm-02, ...
192198
if [[ "$arch_contains_arm" == "1" || "$board_contains_arm" == "1" ]]; then
193-
if [[ "$board" != *"arm"* ]]; then
199+
if [[ "$board" != *"arm-"* ]]; then
194200
skip_build=1
195201
fi
196202
197-
# For "Arch / Board: arm64": Build other
203+
# For "Arch / Board: arm64": Build arm64-01
198204
elif [[ "$arch_contains_arm64" == "1" || "$board_contains_arm64" == "1" ]]; then
199-
if [[ "$board" != *"other"* ]]; then
205+
if [[ "$board" != *"arm64-"* ]]; then
200206
skip_build=1
201207
fi
202208
203-
# For "Arch / Board: risc-v": Build risc-v-01, risc-v-02
209+
# For "Arch / Board: risc-v": Build risc-v-01, risc-v-02, ...
204210
elif [[ "$arch_contains_riscv" == "1" || "$board_contains_riscv" == "1" ]]; then
205-
if [[ "$board" != *"risc-v"* ]]; then
211+
if [[ "$board" != *"risc-v-"* ]]; then
206212
skip_build=1
207213
fi
208214
209215
# For "Arch / Board: simulator": Build sim-01, sim-02
210216
elif [[ "$arch_contains_sim" == "1" || "$board_contains_sim" == "1" ]]; then
211-
if [[ "$board" != *"sim"* ]]; then
217+
if [[ "$board" != *"sim-"* ]]; then
212218
skip_build=1
213219
fi
214220

215-
# For "Arch / Board: x86_64": Build other
221+
# For "Arch / Board: x86_64": Build x86_64-01
216222
elif [[ "$arch_contains_x86_64" == "1" || "$board_contains_x86_64" == "1" ]]; then
217-
if [[ "$board" != *"other"* ]]; then
223+
if [[ "$board" != *"x86_64-"* ]]; then
218224
skip_build=1
219225
fi
220226

221227
# For "Arch / Board: xtensa": Build xtensa-01, xtensa-02
222228
elif [[ "$arch_contains_xtensa" == "1" || "$board_contains_xtensa" == "1" ]]; then
223-
if [[ "$board" != *"xtensa"* ]]; then
229+
if [[ "$board" != *"xtensa-"* ]]; then
224230
skip_build=1
225231
fi
226232

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
os: Linux
121121
boards: |
122122
[
123-
"arm-01", "other", "risc-v-01", "sim-01", "xtensa-01",
123+
"arm-01", "risc-v-01", "sim-01", "xtensa-01", "arm64-01", "x86_64-01", "other",
124124
"arm-02", "risc-v-02", "sim-02", "xtensa-02",
125125
"arm-03", "risc-v-03",
126126
"arm-04", "risc-v-04",

0 commit comments

Comments
 (0)