Add ARMv7 as CI test target

This commit is contained in:
Adam Reichold 2019-06-10 10:56:35 +02:00
parent 8dac328ea7
commit 7f5c55992e
3 changed files with 26 additions and 17 deletions

2
.cargo/config Normal file
View File

@ -0,0 +1,2 @@
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

View File

@ -1,25 +1,24 @@
dist: trusty dist: xenial
sudo: required
language: language:
- rust - rust
- cpp - cpp
rust:
- nightly matrix:
- stable fast_finish: true
addons: include:
apt: - rust: nightly
sources: - rust: stable
- ubuntu-toolchain-r-test - rust: stable
packages: env: TARGET=armv7-unknown-linux-gnueabihf
- gcc-8
- g++-8
- cmake
env:
- CC=/usr/bin/gcc-8 CXX=/usr/bin/g++-8
install: install:
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then rustup target add wasm32-unknown-unknown; fi - 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 - rustup component add rustfmt
- sudo apt-get install --yes cmake
script: script:
- cargo fmt --all -- --check - cargo fmt --all -- --check
# Make sure nightly targets are not broken. # 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 - if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo check --benches --manifest-path=benches/Cargo.toml; fi
# Make sure `no_std` version checks. # Make sure `no_std` version checks.
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo +nightly check --no-default-features --features core; fi - if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo +nightly check --no-default-features --features core; fi
- ./test.sh - travis_wait 60 ./test.sh
- ./doc.sh - ./doc.sh
after_success: | after_success: |
# Build documentation and deploy it to github pages. # Build documentation and deploy it to github pages.
[ $TRAVIS_BRANCH = master ] && [ $TRAVIS_BRANCH = master ] &&
@ -37,6 +37,7 @@ after_success: |
sudo pip install ghp-import && sudo pip install ghp-import &&
ghp-import -n target/doc && ghp-import -n target/doc &&
git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
cache: cargo cache: cargo
before_cache: before_cache:
# Travis can't cache files that are not readable by "others" # Travis can't cache files that are not readable by "others"

View File

@ -2,8 +2,14 @@
set -eux set -eux
EXTRA_ARGS=""
if [ -n "${TARGET-}" ]; then
EXTRA_ARGS="--target=${TARGET} -- --test-threads=1"
fi
cd $(dirname $0) cd $(dirname $0)
time cargo test --all time cargo test --all ${EXTRA_ARGS}
cd - cd -