Skip to content

Commit dfc0023

Browse files
authored
Merge pull request #4125 from tgross35/fix-filter
ci: Ensure build channels get run even if FILTER is unset
2 parents 05e45fd + 907c6d6 commit dfc0023

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

ci/build.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set -eux
1111
: "${OS?The OS environment variable must be set.}"
1212

1313
rust="$TOOLCHAIN"
14+
filter="${FILTER:-}"
1415

1516
echo "Testing Rust $rust on $OS"
1617

@@ -21,7 +22,7 @@ fi
2122
test_target() {
2223
build_cmd="${1}"
2324
target="${2}"
24-
no_std="${3}"
25+
no_std="${3:-}"
2526

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

198199
for target in $targets; do
199-
if echo "$target" | grep -q "$FILTER"; then
200+
if echo "$target" | grep -q "$filter"; then
200201
if [ "${OS}" = "windows" ]; then
201202
TARGET="$target" sh ./ci/install-rust.sh
202203
test_target build "$target"
203204
else
204205
test_target build "$target"
205206
fi
207+
208+
test_run=1
206209
fi
207210
done
208211

@@ -276,8 +279,10 @@ x86_64-wrs-vxworks \
276279
if [ "${rust}" = "nightly" ] && [ "${OS}" = "linux" ]; then
277280
for target in $rust_linux_no_core_targets; do
278281
if echo "$target" | grep -q "$FILTER"; then
279-
test_target build "$target" 1
282+
test_target "$target" 1
280283
fi
284+
285+
test_run=1
281286
done
282287
fi
283288

@@ -290,7 +295,15 @@ i386-apple-ios \
290295
if [ "${rust}" = "nightly" ] && [ "${OS}" = "macos" ]; then
291296
for target in $rust_apple_no_core_targets; do
292297
if echo "$target" | grep -q "$FILTER"; then
293-
test_target build "$target" 1
298+
test_target "$target" 1
294299
fi
300+
301+
test_run=1
295302
done
296303
fi
304+
305+
# Make sure we didn't accidentally filter everything
306+
if [ "${test_run:-}" != 1 ]; then
307+
echo "No tests were run"
308+
exit 1
309+
fi

0 commit comments

Comments
 (0)