Skip to content

Commit

Permalink
Merge pull request #4125 from tgross35/fix-filter
Browse files Browse the repository at this point in the history
ci: Ensure build channels get run even if FILTER is unset
  • Loading branch information
tgross35 authored Nov 20, 2024
2 parents 05e45fd + 907c6d6 commit dfc0023
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set -eux
: "${OS?The OS environment variable must be set.}"

rust="$TOOLCHAIN"
filter="${FILTER:-}"

echo "Testing Rust $rust on $OS"

Expand All @@ -21,7 +22,7 @@ fi
test_target() {
build_cmd="${1}"
target="${2}"
no_std="${3}"
no_std="${3:-}"

# If there is a std component, fetch it:
if [ "${no_std}" != "1" ]; then
Expand Down Expand Up @@ -196,13 +197,15 @@ case "${OS}" in
esac

for target in $targets; do
if echo "$target" | grep -q "$FILTER"; then
if echo "$target" | grep -q "$filter"; then
if [ "${OS}" = "windows" ]; then
TARGET="$target" sh ./ci/install-rust.sh
test_target build "$target"
else
test_target build "$target"
fi

test_run=1
fi
done

Expand Down Expand Up @@ -276,8 +279,10 @@ x86_64-wrs-vxworks \
if [ "${rust}" = "nightly" ] && [ "${OS}" = "linux" ]; then
for target in $rust_linux_no_core_targets; do
if echo "$target" | grep -q "$FILTER"; then
test_target build "$target" 1
test_target "$target" 1
fi

test_run=1
done
fi

Expand All @@ -290,7 +295,15 @@ i386-apple-ios \
if [ "${rust}" = "nightly" ] && [ "${OS}" = "macos" ]; then
for target in $rust_apple_no_core_targets; do
if echo "$target" | grep -q "$FILTER"; then
test_target build "$target" 1
test_target "$target" 1
fi

test_run=1
done
fi

# Make sure we didn't accidentally filter everything
if [ "${test_run:-}" != 1 ]; then
echo "No tests were run"
exit 1
fi

0 comments on commit dfc0023

Please sign in to comment.