From 4b8560651cb6a4f748e88aed7319320c144c412d Mon Sep 17 00:00:00 2001 From: sebcrozet Date: Thu, 24 May 2018 18:29:52 +0200 Subject: [PATCH] Improve CI to include xargo builds. --- .travis.yml | 50 ++++++++++++++++++++++++++++---------------------- ci/build.sh | 8 ++++++++ ci/test.sh | 10 ++++++++++ 3 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 ci/build.sh create mode 100644 ci/test.sh diff --git a/.travis.yml b/.travis.yml index 52a8a75a..5e094a4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,21 @@ sudo: false language: rust -matrix: - include: - - rust: nightly - env: TEST_SUITE=suite_nightly - - rust: beta - env: TEST_SUITE=suite_beta - - rust: stable - env: TEST_SUITE=suite_stable - allow_failures: - - rust: nightly - - rust: beta +rust: + - nightly + - beta + - stable + +env: + - CARGO_FEATURES="" + - CARGO_FEATURES="arbitrary" + - CARGO_FEATURES="mint" + - CARGO_FEATURES="alloc" + - CARGO_FEATURES="serde-serialize" + - CARGO_FEATURES="abomonation-serialize" + - CARGO_FEATURES="debug arbitrary mint serde-serialize abomonation-serialize" + - NO_STD=1 CARGO_FEATURES="" + - NO_STD=1 CARGO_FEATURES="alloc" + addons: apt: packages: @@ -20,15 +25,16 @@ addons: script: - rustc --version - cargo --version - - cargo build --verbose - - cargo build --verbose --features arbitrary - - cargo build --verbose --features mint - - cargo build --verbose --features serde-serialize - - cargo build --verbose --features abomonation-serialize - - cargo test --verbose - - cargo test --verbose --features "debug arbitrary mint serde-serialize abomonation-serialize" - - cd nalgebra-lapack; cargo test --verbose + - ./ci/build.sh + - ./ci/test.sh -env: - matrix: - - CARGO_FEATURE_SYSTEM_NETLIB=1 CARGO_FEATURE_EXCLUDE_LAPACKE=1 CARGO_FEATURE_EXCLUDE_CBLAS=1 +matrix: + exclude: + - rust: stable + env: NO_STD=1 + - rust: beta + env: NO_STD=1 + # - rust: stable + # NO_STD=1 CARGO_FEATURES="alloc" + # - rust: beta + # NO_STD=1 CARGO_FEATURES="alloc" diff --git a/ci/build.sh b/ci/build.sh new file mode 100644 index 00000000..3237a508 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,8 @@ +#! /bin/bash + +if [ -z NO_STD ]; then + cargo build --verbose --features "${CARGO_FEATURES}"; +else + cargo install xargo; + xargo build --verbose --no-default-features --target=x86_64-unknown-linux-gnu --features "${CARGO_FEATURES}"; +fi \ No newline at end of file diff --git a/ci/test.sh b/ci/test.sh new file mode 100644 index 00000000..544f6a50 --- /dev/null +++ b/ci/test.sh @@ -0,0 +1,10 @@ +#! /bin/bash + +if [ -z NO_STD ]; then + cargo test --verbose ${CARGO_FEATURES}; + + if [ -z CARGO_FEATURES ]; then + export CARGO_FEATURE_SYSTEM_NETLIB=1 CARGO_FEATURE_EXCLUDE_LAPACKE=1 CARGO_FEATURE_EXCLUDE_CBLAS=1 + cd nalgebra-lapack; cargo test --verbose; + fi +fi \ No newline at end of file