Skip to content

Commit 6124a04

Browse files
author
Jorge Aparicio
committed
move the commands into scripts
1 parent 8879283 commit 6124a04

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

.travis.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,10 @@ matrix:
1313
env: TARGET=x86_64-unknown-linux-gnu
1414

1515
install:
16-
# NOTE(TRAVIS_BRANCH) Travis is configured to only build *pushes* (not PRs).
17-
- if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_EVENT_TYPE = cron ]; then
18-
curl https://sh.rustup.rs -sSf |
19-
sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION;
20-
21-
source ~/.cargo/env;
22-
23-
curl -LSfs http://japaric.github.io/trust/install.sh | \
24-
sh -s -- --force --git japaric/cross --tag v0.1.2 --target x86_64-unknown-linux-gnu --to ~/.cargo/bin;
25-
fi
16+
- sh ci/install.sh
2617

2718
script:
28-
# NOTE(TRAVIS_BRANCH) See the NOTE in the `install` section
29-
- if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_EVENT_TYPE = cron ]; then
30-
sh ci/script.sh;
31-
fi
19+
- sh ci/script.sh
3220

3321
cache: cargo
3422
before_cache:

ci/install.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set -ex
2+
3+
main() {
4+
curl https://sh.rustup.rs -sSf | \
5+
sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION
6+
7+
source ~/.cargo/env
8+
9+
curl -LSfs http://japaric.github.io/trust/install.sh | \
10+
sh -s -- --force --git japaric/cross --tag v0.1.2 --target $TARGET
11+
}
12+
13+
# NOTE(TRAVIS_BRANCH) Travis is configured to only build *pushes* (not PRs)
14+
if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_EVENT_TYPE = cron ]; then
15+
main
16+
fi

ci/script.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ main() {
1111
esac
1212
}
1313

14-
main
14+
# NOTE See the NOTE in `install.sh`
15+
if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_EVENT_TYPE = cron ]; then
16+
main
17+
fi

0 commit comments

Comments
 (0)