summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: d97e86f9e9d0e75bce963d5ba4b099d59388874d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
language: rust
services: docker
cache:
  - cargo

matrix:
  include:
    - rust: 1.46.0 # MSRV
    - rust: stable
    - rust: beta
    - rust: nightly
    - os: osx
    # Tier 1
    - env: CROSS_TEST=i686-unknown-linux-gnu
    # Tier 2
    - env: CROSS_TEST=aarch64-unknown-linux-gnu
    - env: CROSS_CHECK=wasm32-unknown-unknown

script:
  - |
    set -e
    if [[ "$TRAVIS_RUST_VERSION" == nightly ]]
    then
        # Make sure the benchmarks compile
        cargo build --benches --all

        export ASAN_OPTIONS="detect_odr_violation=0 detect_leaks=0"
        export RUST_BACKTRACE=1

        # Run address sanitizer
        RUSTFLAGS="-Z sanitizer=address" \
        cargo test --lib --target x86_64-unknown-linux-gnu
    fi
  - |
    set -e
    if [[ "$CROSS_CHECK" ]]
    then
        rustup target add $CROSS_CHECK
        cargo check --target $CROSS_CHECK
        cargo check --target $CROSS_CHECK --no-default-features
    elif [[ "$CROSS_TEST" ]]
    then
        cargo install --force cross
        cross test --target=$CROSS_TEST
        cross check --target $CROSS_TEST --no-default-features
    else
        cargo test --no-fail-fast
        cargo test --no-fail-fast --release
        cargo check --no-default-features
    fi