Skip to content

Commit 5433420

Browse files
committed
update travis
1 parent 12db823 commit 5433420

4 files changed

Lines changed: 88 additions & 1 deletion

File tree

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ branches:
1313

1414
env:
1515
global:
16-
- secure: eYvJL9qSyPPcopyquSMWVjNI7svMuTqqjRTGDXlyN3fcYMUraWV69qJBVRmSuMIo6KvGnKWZz8Ari7+fq8RybQteVaaQS+PrlwVnjJidB8ELq3wDDKD7bj9iRIjOyfwYUe3oEN4Y+XYOwyICBDq7bC6vIf9OIlhZg9jQ+tweXKKPEjQ68+MIhUDXbH8VPYd4SREsmE6q9zPTJ54l5cBmZDED0QF5RWgrt9Gn8pgW+u2utYcT/0iJnf//WLb2nCxfzATkVQFnyTni+RJnngBJ7KDZR2qlpOxdoV6iax0I6SXwx2TIxNUyLhmFomFrIkIjHjlQRq+NBKy/ehUK4TvpRxWWMgCzTxrd3STCeFR+HnDbspMAUzlnBGdMrxPH3LCj9KgkekaJMZ29ryZYCtaFnO58FiTUBreNDWibcWRqXmwhbMzWT6pLRzuYjYH0jIm5WjnleKTznpN4Me5VMVUBpzdAPs0VKvhGavJn4bT/5W1dhFmhuNlD5kCdkjD5oZI74MyxepTr4Bg0wo3bLSjfmyq77Qxvo9HcVxhukBAIwvILElWL5UK+dguEJWP/iqtbfwxfa7tTOrIF3GTfL3fSfI2B/pAUzGnzWzFaZWU357NEDZOCXACoUEhG3JYNwR6//YvJaXBVoQHAq+ZSd4oEyrAnaDjnBJr1CBfWVTpyfFI=
1716
- CRATE_NAME=git-codeowners
1817
- TARGET=x86_64-unknown-linux-musl
1918
- OS=Linux

ci/before_deploy.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This script takes care of building your crate and packaging it for release
2+
3+
set -ex
4+
5+
main() {
6+
local src=$(pwd) \
7+
stage=
8+
9+
case $TRAVIS_OS_NAME in
10+
linux)
11+
stage=$(mktemp -d)
12+
;;
13+
osx)
14+
stage=$(mktemp -d -t tmp)
15+
;;
16+
esac
17+
18+
test -f Cargo.lock || cargo generate-lockfile
19+
20+
# TODO Update this to build the artifacts that matter to you
21+
cross rustc --bin git-codeowners --target $TARGET --release -- -C lto
22+
23+
# TODO Update this to package the right artifacts
24+
cp target/$TARGET/release/git-codeowners $stage/
25+
26+
cd $stage
27+
tar czf $src/$CRATE_NAME-$OS-$ARCH.tar.gz *
28+
cd $src
29+
30+
rm -rf $stage
31+
}
32+
33+
main

ci/install.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
set -ex
2+
3+
main() {
4+
curl https://sh.rustup.rs -sSf | \
5+
sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION
6+
7+
local target=
8+
if [ $TRAVIS_OS_NAME = linux ]; then
9+
target=x86_64-unknown-linux-musl
10+
sort=sort
11+
else
12+
target=x86_64-apple-darwin
13+
sort=gsort # for `sort --sort-version`, from brew's coreutils.
14+
fi
15+
16+
# This fetches latest stable release
17+
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
18+
| cut -d/ -f3 \
19+
| grep -E '^v[0-9.]+$' \
20+
| $sort --version-sort \
21+
| tail -n1)
22+
echo cross version: $tag
23+
curl -LSfs https://japaric.github.io/trust/install.sh | \
24+
sh -s -- \
25+
--force \
26+
--git japaric/cross \
27+
--tag $tag \
28+
--target $target
29+
}
30+
31+
main

ci/script.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This script takes care of testing your crate
2+
3+
set -ex
4+
5+
# TODO This is the "test phase", tweak it as you see fit
6+
main() {
7+
cross build -v --target $TARGET
8+
cross build -v --target $TARGET --release
9+
10+
if [ -n $DISABLE_TESTS ]; then
11+
return
12+
fi
13+
14+
cross test --target $TARGET
15+
cross test --target $TARGET --release
16+
17+
cross run --target $TARGET
18+
cross run --target $TARGET --release
19+
}
20+
21+
# we don't run the "test phase" when doing deploys
22+
if [ -z $TRAVIS_TAG ]; then
23+
main
24+
fi

0 commit comments

Comments
 (0)