Skip to content

Commit 5fd2b22

Browse files
committed
ci(mobile-e2e): drop bash-4 mapfile (macOS ships bash 3.2)
mac runners default /bin/bash to Apple's 3.2 fork, which lacks mapfile. Use the same find | while | grep | xargs pipeline as the Android job; skip-messages go to stderr so xargs only sees kept paths.
1 parent a9c6fda commit 5fd2b22

1 file changed

Lines changed: 19 additions & 27 deletions

File tree

.github/workflows/mobile-e2e.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -892,34 +892,26 @@ jobs:
892892
# DIRECTORY; with explicit file paths Maestro runs every file
893893
# regardless of tag. We want per-flow invocation (so one
894894
# crash/hang can't poison the rest) AND tag filtering, so
895-
# pre-filter the file list here in shell.
895+
# pre-filter the file list. macOS ships bash 3.2 (no mapfile),
896+
# so this uses a portable pipe: skip-messages go to stderr so
897+
# only kept paths flow into xargs.
896898
excluded="$EXCLUDE_TAGS,androidOnly"
897-
# Build a grep -E alternation: '^\s*-\s*(tag1|tag2|...)\s*$'
898-
pattern="^[[:space:]]*-[[:space:]]*($(echo "$excluded" | sed 's/,/|/g'))[[:space:]]*$"
899-
mapfile -d '' files < <(
900-
find flows -type f -name "*.yaml" ! -path "*/common/*" \
901-
${FLOWS_FILTER:+-path "*$FLOWS_FILTER*"} -print0
902-
)
903-
kept=()
904-
for f in "${files[@]}"; do
905-
if grep -qE "$pattern" "$f"; then
906-
echo "::group::Skip $f (matches excluded tag in $excluded)"
907-
grep -E "$pattern" "$f"
908-
echo "::endgroup::"
909-
else
910-
kept+=("$f")
911-
fi
912-
done
913-
if [ "${#kept[@]}" -eq 0 ]; then
914-
echo "::warning::No flows left to run after tag filter"
915-
exit 0
916-
fi
917-
# `xargs -n 1` runs maestro test once per flow so a hanging
918-
# flow can't poison the rest.
919-
printf '%s\0' "${kept[@]}" | xargs -0 -n 1 maestro test \
920-
--env CLERK_TEST_EMAIL="$CLERK_TEST_EMAIL" \
921-
--env CLERK_TEST_PASSWORD="$CLERK_TEST_PASSWORD" \
922-
--flatten-debug-output
899+
pattern="$(echo "$excluded" | sed 's/,/|/g')"
900+
find flows -type f -name '*.yaml' ! -path '*/common/*' \
901+
${FLOWS_FILTER:+-path "*$FLOWS_FILTER*"} | \
902+
while IFS= read -r f; do
903+
if grep -qE "^[[:space:]]*-[[:space:]]*(${pattern})[[:space:]]*\$" "$f"; then
904+
echo "::group::Skip $f (matches excluded tag in ${excluded})" >&2
905+
grep -E "^[[:space:]]*-[[:space:]]*(${pattern})[[:space:]]*\$" "$f" >&2
906+
echo "::endgroup::" >&2
907+
else
908+
printf '%s\n' "$f"
909+
fi
910+
done | \
911+
xargs -n 1 maestro test \
912+
--env CLERK_TEST_EMAIL="$CLERK_TEST_EMAIL" \
913+
--env CLERK_TEST_PASSWORD="$CLERK_TEST_PASSWORD" \
914+
--flatten-debug-output
923915
924916
- name: Upload Maestro artifacts on failure or cancel
925917
if: failure() || cancelled()

0 commit comments

Comments
 (0)