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

View File

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