Skip to content

Commit 25a1aed

Browse files
author
Bryant Mairs
committed
Support building and testing multiple targets at once
Specifying multiple targets can be done by setting the environment variable to a semi-colon delimited list of targets.
1 parent d96518c commit 25a1aed

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed

ci/install.sh

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,26 @@ main() {
1212

1313
# Builds for iOS are done on OSX, but require the specific target to be
1414
# installed.
15-
case $TARGET in
16-
aarch64-apple-ios)
17-
rustup target install aarch64-apple-ios
18-
;;
19-
armv7-apple-ios)
20-
rustup target install armv7-apple-ios
21-
;;
22-
armv7s-apple-ios)
23-
rustup target install armv7s-apple-ios
24-
;;
25-
i386-apple-ios)
26-
rustup target install i386-apple-ios
27-
;;
28-
x86_64-apple-ios)
29-
rustup target install x86_64-apple-ios
30-
;;
31-
esac
15+
IFS=';' read -ra TARGET_ARRAY <<< "$TARGET"
16+
for t in "${TARGET_ARRAY[@]}"; do
17+
case $t in
18+
aarch64-apple-ios)
19+
rustup target install aarch64-apple-ios
20+
;;
21+
armv7-apple-ios)
22+
rustup target install armv7-apple-ios
23+
;;
24+
armv7s-apple-ios)
25+
rustup target install armv7s-apple-ios
26+
;;
27+
i386-apple-ios)
28+
rustup target install i386-apple-ios
29+
;;
30+
x86_64-apple-ios)
31+
rustup target install x86_64-apple-ios
32+
;;
33+
esac
34+
done
3235

3336
# This fetches latest stable release
3437
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \

ci/script.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@ main() {
88
export RUSTFLAGS=--cfg=travis
99
fi
1010

11-
# Build debug and release targets
12-
cross build --target $TARGET
13-
cross build --target $TARGET --release
11+
IFS=';' read -ra TARGET_ARRAY <<< "$TARGET"
12+
for t in "${TARGET_ARRAY[@]}"; do
13+
# Build debug and release targets
14+
cross build --target $t
15+
cross build --target $t --release
1416

15-
if [ ! -z $DISABLE_TESTS ]; then
16-
return
17-
fi
17+
if [ ! -z $DISABLE_TESTS ]; then
18+
continue
19+
fi
1820

19-
# Run tests on debug and release targets.
20-
cross test --target $TARGET
21-
cross test --target $TARGET --release
21+
# Run tests on debug and release targets.
22+
cross test --target $t
23+
cross test --target $t --release
24+
done
2225
}
2326

2427
# we don't run the "test phase" when doing deploys

0 commit comments

Comments
 (0)