language: rust
rust: nightly
git:
depth: 10
addons:
apt:
packages:
- gcc-multilib
env:
global:
- RUST_LINT_VERSION=nightly-2019-01-09
matrix:
include:
- os: linux
dist: precise env: CHECK="" BUILD="" RUN="x86_64-unknown-linux-gnu i686-unknown-linux-gnu x86_64-unknown-linux-musl i686-unknown-linux-musl" RUSTFLAGS_VARIATIONS=";" DIST="precise" - os: linux
dist: trusty
env: CHECK="" BUILD="" RUN="x86_64-unknown-linux-gnu i686-unknown-linux-gnu x86_64-unknown-linux-musl i686-unknown-linux-musl" RUSTFLAGS_VARIATIONS=";" DIST="trusty" - os: linux
dist: xenial
env: CHECK="i686-pc-windows-gnu x86_64-pc-windows-gnu x86_64-unknown-freebsd x86_64-unknown-netbsd" BUILD="" RUN="x86_64-unknown-linux-gnu i686-unknown-linux-gnu x86_64-unknown-linux-musl i686-unknown-linux-musl" RUSTFLAGS_VARIATIONS=";" DIST="trusty" - os: osx
osx_image: xcode6.4 env: CHECK="" BUILD="" RUN="x86_64-apple-darwin i686-apple-darwin" RUSTFLAGS_VARIATIONS=";" - os: osx
osx_image: xcode8.3
env: CHECK="" BUILD="" RUN="x86_64-apple-darwin i686-apple-darwin" RUSTFLAGS_VARIATIONS=";" - os: osx
osx_image: xcode9.4
env: CHECK="" BUILD="x86_64-unknown-linux-musl i686-unknown-linux-musl aarch64-apple-ios armv7-apple-ios armv7s-apple-ios i386-apple-ios x86_64-apple-ios" RUN="x86_64-apple-darwin i686-apple-darwin" RUSTFLAGS_VARIATIONS=";"
before_script: |
( set -o errexit;set -o pipefail; set -o xtrace;set -o nounset;
if [ "$TRAVIS_OS_NAME" = "linux" -a "${DIST-}" = "precise" ]; then
# Bump libstdc++6 for libLLVM-8svn.so which requires GLIBCXX_3.4.17 https://askubuntu.com/questions/575505/glibcxx-3-4-20-not-found-how-to-fix-this-error
sudo -E add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo -E apt-get update
sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install libstdc++6-4.7-dev
fi
for TARGET in $CHECK $BUILD $RUN; do [ "$TARGET" = $(rustup target list | grep default | grep -o -e '^[^ ]\+') ] || travis_retry rustup target add "$TARGET"; done
travis_retry rustup toolchain add $RUST_LINT_VERSION
travis_retry rustup component add rustfmt --toolchain $RUST_LINT_VERSION
travis_retry rustup component add clippy --toolchain $RUST_LINT_VERSION
for TARGET in $CHECK $BUILD $RUN; do [ "$TARGET" = $(rustup target list | grep default | grep -o -e '^[^ ]\+') ] || travis_retry rustup target add --toolchain $RUST_LINT_VERSION "$TARGET"; done
)
script: |
( set -o errexit;set -o pipefail; set -o xtrace;set -o nounset;
cargo +$RUST_LINT_VERSION fmt -- --check
OLD_IFS=$IFS IFS=";"; for RUSTFLAGS in $RUSTFLAGS_VARIATIONS; do ( IFS=$OLD_IFS
export RUSTFLAGS
for TARGET in $CHECK $BUILD $RUN; do (
cargo +$RUST_LINT_VERSION clippy --target "$TARGET" --all-targets --all-features -- -D warnings
); done
for TARGET in $BUILD $RUN; do (
[ \( "$TRAVIS_OS_NAME" = "osx" -o \( "$TRAVIS_OS_NAME" = "linux" -a "${DIST-}" = "precise" \) \) -a \( "$TARGET" = "x86_64-unknown-linux-musl" -o "$TARGET" = "i686-unknown-linux-musl" \) ] && RUSTFLAGS="$RUSTFLAGS -C linker=rust-lld"
cargo build --verbose --target "$TARGET" --all-targets --all-features
case "${TARGET%%-*}" in i386|i686|x86_64) RUSTFLAGS="$RUSTFLAGS -C target-cpu=native";; esac
cargo build --verbose --target "$TARGET" --all-targets --all-features --release
); done
for TARGET in $RUN; do (
[ \( "$TRAVIS_OS_NAME" = "osx" -o \( "$TRAVIS_OS_NAME" = "linux" -a "${DIST-}" = "precise" \) \) -a \( "$TARGET" = "x86_64-unknown-linux-musl" -o "$TARGET" = "i686-unknown-linux-musl" \) ] && RUSTFLAGS="$RUSTFLAGS -C linker=rust-lld"
RUST_BACKTRACE=full cargo test --target "$TARGET" --all-features
RUSTFLAGS="$RUSTFLAGS -C target-cpu=native" RUST_BACKTRACE=full cargo test --target "$TARGET" --all-features --release
RUSTFLAGS="$RUSTFLAGS -C target-cpu=native" RUST_BACKTRACE=full cargo bench --target "$TARGET" --all-features
[ ! -d examples ] || for example in examples/*; do example=${example##*/}; (
RUST_BACKTRACE=full cargo run --target "$TARGET" --example ${example%.*} --all-features
RUSTFLAGS="$RUSTFLAGS -C target-cpu=native" RUST_BACKTRACE=full cargo run --target "$TARGET" --example ${example%.*} --all-features --release
); done
); done
); done; IFS=$OLD_IFS
for TARGET in $CHECK $BUILD $RUN; do
cargo +$RUST_LINT_VERSION doc --no-deps --target "$TARGET" --all-features --release &>/dev/null
done
)
notifications:
email: false