Skip to content

Commit 860539f

Browse files
committed
Make the cross scripts compatible with Cirrus
1 parent dc6652e commit 860539f

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

ci/install.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
set -ex
33

44
main() {
55
local target=
6-
if [ $TRAVIS_OS_NAME = linux ]; then
6+
if [ `uname` = "Linux" ]; then
77
target=x86_64-unknown-linux-musl
8-
sort=sort
8+
else if [ `uname` = "FreeBSD" ]; then
9+
target=x86_64-unknown-freebsd
910
else
1011
target=x86_64-apple-darwin
12+
fi
13+
14+
if which -s gsort; then
1115
sort=gsort # for `sort --sort-version`, from brew's coreutils.
16+
else
17+
sort=sort
1218
fi
1319

1420
# Builds for iOS are done on OSX, but require the specific target to be

ci/script.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
# This script takes care of testing your crate
33

44
set -ex
@@ -8,24 +8,27 @@ main() {
88
if [ "$TRAVIS" = true ]; then
99
export RUSTFLAGS=--cfg=travis
1010
fi
11+
if [ "$CIRRUS_CI" = true ]; then
12+
export RUSTFLAGS=--cfg=cirrus
13+
fi
1114

1215
IFS=';' read -ra TARGET_ARRAY <<< "$TARGET"
1316
for t in "${TARGET_ARRAY[@]}"; do
14-
# Build debug and release targets
15-
cross build --target $t
16-
cross build --target $t --release
17+
# Build debug and release targets
18+
cross build --target $t
19+
cross build --target $t --release
1720

18-
if [ ! -z $DISABLE_TESTS ]; then
19-
continue
20-
fi
21+
if [ ! -z $DISABLE_TESTS ]; then
22+
continue
23+
fi
2124

22-
# Run tests on debug and release targets.
23-
cross test --target $t
24-
cross test --target $t --release
25+
# Run tests on debug and release targets.
26+
cross test --target $t
27+
cross test --target $t --release
2528
done
2629
}
2730

2831
# we don't run the "test phase" when doing deploys
29-
if [ -z $TRAVIS_TAG ]; then
32+
if [ -z "$TRAVIS_TAG" -a -z "$CIRRUS_TAG" ]; then
3033
main
3134
fi

0 commit comments

Comments
 (0)