Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Ensure build channels get run even if FILTER is unset #4125

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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