Merge pull request #770 from mattico/improve-travis

Improve CI
This commit is contained in:
Matt Ickstadt 2018-08-22 08:55:06 -05:00 committed by GitHub
commit 5baaf55abc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 58 deletions

View File

@ -1,5 +1,14 @@
language: rust
rust:
- stable
- beta
- nightly
os:
- linux
- osx
cache:
timeout: 360
cargo: true
@ -10,16 +19,10 @@ before_cache:
env:
global:
- CRATE_NAME=mdbook
- TARGET=x86_64-unknown-linux-gnu
install:
- sh ci/install.sh
- export PATH=$PATH:$HOME/.cargo/bin
script:
- cargo build --all --no-default-features
- cargo build --verbose
- cargo test --verbose
- cargo test --all
- cargo test --all --no-default-features
before_deploy:
- sh ci/before_deploy.sh

View File

@ -36,12 +36,12 @@ build: false
# Equivalent to Travis' `script` phase
test_script:
- cargo build --verbose
- cargo test --verbose
- cargo test --all
- cargo test --all --no-default-features
before_deploy:
# Generate artifacts for release
- cargo build --release
- cargo rustc --bin mdbook --release -- -C lto
- mkdir staging
- copy target\release\mdbook.exe staging
- cd staging

View File

@ -1,47 +0,0 @@
set -ex
main() {
local target=
if [ $TRAVIS_OS_NAME = linux ]; then
target=x86_64-unknown-linux-musl
sort=sort
else
target=x86_64-apple-darwin
sort=gsort # for `sort --sort-version`, from brew's coreutils.
fi
# Builds for iOS are done on OSX, but require the specific target to be
# installed.
case $TARGET in
aarch64-apple-ios)
rustup target install aarch64-apple-ios
;;
armv7-apple-ios)
rustup target install armv7-apple-ios
;;
armv7s-apple-ios)
rustup target install armv7s-apple-ios
;;
i386-apple-ios)
rustup target install i386-apple-ios
;;
x86_64-apple-ios)
rustup target install x86_64-apple-ios
;;
esac
# This fetches latest stable release
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
| cut -d/ -f3 \
| grep -E '^v[0.1.0-9.]+$' \
| $sort --version-sort \
| tail -n1)
curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- \
--force \
--git japaric/cross \
--tag $tag \
--target $target
}
main