language: rust
branches:
  only:
    - crashey
    - master
    - allocator-fixes
    - rust-build

rust:
  - stable
  
compiler:
  - gcc
  - clang

# 3 profiles for clang and gcc
env:
  -
  - SUBNODE=1

script:
  - uname -a
  - if test "1" = "$SUBNODE"; then echo "Subnode build"; fi
  - ./do

matrix:
  include:
    - name: "check js"
      script:
        - "bash node_build/run_jshint"

    ## TODO(cjd) merge allocator-fixes and enable this
    # - name: "AddressSanitizer"
    #   addons:
    #     apt:
    #       sources:
    #         - llvm-toolchain-trusty-5.0
    #       packages:
    #         - llvm-5.0-dev
    #         - clang-5.0
    #         - libclang-common-5.0-dev
    #   script:
    #     - export CC=clang
    #     - export CXX=clang++
    #     - export PATH=/usr/lib/llvm-5.0/bin/:$PATH
    #     - export CFLAGS=-fsanitize=address
    #     - export LDFLAGS=-fsanitize=address
    #     - export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-5.0/bin/llvm-symbolizer
    #     - ./do
    #     - ./build_*/test_testcjdroute_c | while read x; do test "$x" != "" && bash -c $x >/dev/null || exit 100; done

    - name: "android"
      script:
        - rustup target add aarch64-linux-android
        - rustup target add i686-linux-android
        - rustup target add x86_64-linux-android
        - ./android_do
