Skip to content
Snippets Groups Projects
.travis.yml 2.28 KiB
Newer Older
Carl Lerche's avatar
Carl Lerche committed
---
Carl Lerche's avatar
Carl Lerche committed
language: rust
services: docker
sudo: required

env:
  global:
    - CRATE_NAME=bytes
    # Default job
    - TARGET=x86_64-unknown-linux-gnu
    - secure: "f17G5kb6uAQlAG9+GknFFYAmngGBqy9h+3FtNbp3mXTI0FOLltz00Ul5kGPysE4eagypm/dWOuvBkNjN01jhE6fCbekmInEsobIuanatrk6TvXT6caJqykxhPJC2cUoq8pKnMqEOuucEqPPUH6Qy6Hz4/2cRu5JV22Uv9dtS29Q="
Carl Lerche's avatar
Carl Lerche committed

matrix:
  include:
    # Run build on oldest supported rust version. Do not change the rust
    # version without a Github issue first.
    #
    # This job will also build and deploy the docs to gh-pages.
    - env: TARGET=x86_64-unknown-linux-gnu
      after_success:
        - |
            pip install 'travis-cargo<0.2' --user &&
            export PATH=$HOME/.local/bin:$PATH
Carl Lerche's avatar
Carl Lerche committed
        - travis-cargo doc
        - travis-cargo doc-upload

    # Run tests on some extra platforms
    - env: TARGET=i686-unknown-linux-gnu
    - env: TARGET=armv7-unknown-linux-gnueabihf
Carl Lerche's avatar
Carl Lerche committed
    - env: RUST_TEST_THREADS=1 TARGET=powerpc-unknown-linux-gnu
    - env: RUST_TEST_THREADS=1 TARGET=powerpc64-unknown-linux-gnu
Carl Lerche's avatar
Carl Lerche committed

    # Serde implementation
    - env: EXTRA_ARGS="--features serde"

    # 128 bit numbers
    - env: EXTRA_ARGS="--features i128"

    # `Either` impls
    - env: EXTRA_ARGS="--features either"

    # WASM support
      script:
        - rustup target add wasm32-unknown-unknown
        - cargo build --target=wasm32-unknown-unknown

    # Sanitizers
    - rust: nightly
      os: linux
      script:
        - |
          set -e

          export RUST_TEST_THREADS=1
          export ASAN_OPTIONS="detect_odr_violation=0 detect_leaks=0"
          export TSAN_OPTIONS="suppressions=`pwd`/ci/tsan"

          # Run address sanitizer
          RUSTFLAGS="-Z sanitizer=address" \
          cargo test --tests --target x86_64-unknown-linux-gnu

          # Run thread sanitizer
          RUSTFLAGS="-Z sanitizer=thread" \
          cargo test --tests --target x86_64-unknown-linux-gnu
before_install: set -e

install:
  - sh ci/install.sh
  - source ~/.cargo/env || true
Carl Lerche's avatar
Carl Lerche committed

script:
  - bash ci/script.sh
Carl Lerche's avatar
Carl Lerche committed

after_script: set +e
Carl Lerche's avatar
Carl Lerche committed

before_deploy:
  - sh ci/before_deploy.sh

cache: cargo
before_cache:
  # Travis can't cache files that are not readable by "others"
  - chmod -R a+r $HOME/.cargo
Carl Lerche's avatar
Carl Lerche committed

notifications:
  email:
    on_success: never