dist: xenial
language: cpp
sudo: required
branches:
  only:
    - master
    - bug_fixes
matrix:
  include:
    # Linux (gcc4.9)
    - os: linux
      language: python
      python: "3.4"
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
            - zlib1g-dev
      env:
        - CC=gcc-4.9
        - CXX=g++-4.9
    # Linux (gcc8)
    - os: linux
      language: python
      python: "3.8"
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-8
            - zlib1g-dev
      env:
        - CC=gcc-8
        - CXX=g++-8
        - CXXFLAGS="-fuse-ld=gold"
    # MacOS
    - os: osx
      osx_image: xcode11.2
      compiler: clang
      env:
        - CC=clang
        - CXX=clang++
        - NPROC="$(sysctl -n hw.activecpu)"
      before_install:
        - brew unlink python@2
    # ARM 64-bit
    - os: linux
      arch: arm64
      compiler: gcc
      env:
        # Set POPCNT_CAPABILITY=0 to avoid build error
        - POPCNT_CAPABILITY=0
      script: travis_wait 30 make -j $NPROC allall
    # IBM Z (big endian)
    - os: linux
      arch: s390x
      env:
        - POPCNT_CAPABILITY=0
    # PPC64LE
    - os: linux
      arch: ppc64le
      env:
        - POPCNT_CAPABILITY=0
cache: apt
env:
  global:
    - NPROC="$(nproc)"
before_script:
  - uname -m
  - python3 --version
  - echo CC=${CC} CXX=${CXX} NPROC=${NPROC}
  - $CC --version
  - $CXX --version
script: make -j $NPROC allall && make simple-test
notifications:
  slack:
    secure: K/SdL+S1lb+Vf3KucmiMh4Fyd9sWmosw+mSRjtAjAzXUYZ3zMp91bM6GzHVD1nonMQWDu3vY6TOApvnikSfd4ZSRhO4ijDda5zF3SN19Uly4vXRTC0C4UKloyVqOjx2uwXU4Mz+7cuO9RCb4CczL2HUG9tiLN5BjfbnHvQlZzsE6dJuo+5BoKq88SbNhlBlGIuLWAsVmpnaozNjowNBLb2+BtrK5KSN5eTyCVerZeoJ2ChexDXGf7SnGVQhgu05hfOB52ti1mzRaTRGY91jnKAibBaO/gyW2Q5/AeBy+OrL5poenM0rAJHjztUCw1lC1G4Mej73YyHn6V1NF0DHSYM9l8aBe0nAweAuB4tuRJ9gJtqR6GjXdqURI5ABBsFIkb9pNbJz59g9sTpKrrWmIqqj7a8Eld7nk1K+IjBVOvDT9x3PWjl/H1sAl+0bRT42lu+zjJV9BIn/Fwn+xC0syRazgDimkfPLbn/aAEBKeofwdk/DHb3amBtbHsEFZsAdI5Mrq/tIuCYO0i7jYxlmNTNsXA5a0gF1OExGJvPPDV2/lp/bPx/ncvcZvwjpst6BEyJURmM5MsMCeHbiuPvlVmA4R29BTMBaW/ZN5smF4E+CkV2IxPlpgh2c+YSX44ikYnG3v4H5QKxLI4W4E+TTn9/1EmdO0KMzNG8gEiNnKcTg=
