Skip to content

Commit f68cc6e

Browse files
committed
test run anchor build github action
1 parent ae5241a commit f68cc6e

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

.github/workflows/anchor.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,30 @@ jobs:
7979
"tokens/token-2022/transfer-hook/anchor/TransferHookTransferCost"
8080
"tokens/token-2022/transfer-hook/anchor/TransferHookWhitelist"
8181
)
82+
declare -a pids=()
83+
declare -a failed_builds=()
84+
8285
for projectDir in "${ProjectDirs[@]}"; do
83-
echo "
84-
********
85-
Building $projectDir
86-
********"
87-
cd $projectDir
88-
if anchor build; then
89-
echo "Build succeeded for $projectDir."
90-
else
91-
failed=true
92-
failed_builds+=($projectDir)
93-
echo "Build failed for $projectDir. Continuing with the next program."
94-
fi
95-
cd - > /dev/null
86+
(
87+
echo "******** Building $projectDir ********"
88+
cd $projectDir
89+
if anchor build; then
90+
echo "Build succeeded for $projectDir."
91+
else
92+
echo "Build failed for $projectDir."
93+
# Capture the directory of failed build
94+
failed_builds+=("$projectDir")
95+
fi
96+
) &
97+
pids+=($!)
9698
done
97-
if [ "$failed" = true ]; then
98-
echo "Programs that failed building:"
99+
100+
for pid in "${pids[@]}"; do
101+
wait $pid
102+
done
103+
104+
if [ ${#failed_builds[@]} -ne 0 ]; then
105+
echo "Some builds failed:"
99106
printf "%s\n" "${failed_builds[@]}"
100107
exit 1
101108
else

0 commit comments

Comments
 (0)