diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000..0c1c209 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[target.armv7-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" diff --git a/.travis.yml b/.travis.yml index e54d69d..7336c16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,24 @@ -dist: trusty -sudo: required +dist: xenial + language: - rust - cpp -rust: - - nightly - - stable -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-8 - - g++-8 - - cmake -env: -- CC=/usr/bin/gcc-8 CXX=/usr/bin/g++-8 + +matrix: + fast_finish: true + include: + - rust: nightly + - rust: stable + - rust: stable + env: TARGET=armv7-unknown-linux-gnueabihf install: - if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then rustup target add wasm32-unknown-unknown; fi +- if [ -n "$TARGET" ]; then rustup target add "$TARGET" && sudo apt-get install --yes qemu-user-static; fi +- if [ "$TARGET" == "armv7-unknown-linux-gnueabihf" ]; then sudo apt-get install --yes crossbuild-essential-armhf && export QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf; fi - rustup component add rustfmt +- sudo apt-get install --yes cmake + script: - cargo fmt --all -- --check # Make sure nightly targets are not broken. @@ -27,8 +26,9 @@ script: - if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo check --benches --manifest-path=benches/Cargo.toml; fi # Make sure `no_std` version checks. - if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo +nightly check --no-default-features --features core; fi -- ./test.sh +- travis_wait 60 ./test.sh - ./doc.sh + after_success: | # Build documentation and deploy it to github pages. [ $TRAVIS_BRANCH = master ] && @@ -37,6 +37,7 @@ after_success: | sudo pip install ghp-import && ghp-import -n target/doc && git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages + cache: cargo before_cache: # Travis can't cache files that are not readable by "others" diff --git a/test.sh b/test.sh index 4ee4c32..ce9aa56 100755 --- a/test.sh +++ b/test.sh @@ -2,8 +2,14 @@ set -eux +EXTRA_ARGS="" + +if [ -n "${TARGET-}" ]; then + EXTRA_ARGS="--target=${TARGET} -- --test-threads=1" +fi + cd $(dirname $0) -time cargo test --all +time cargo test --all ${EXTRA_ARGS} cd -