language: d
sudo: required
packages:
  - pkg-config
d:
 - gdc
 - ldc
 - ldc-beta
 - dmd-nightly
 - dmd-beta
 - dmd
branches:
  only:
    - master
env:
 - ARCH="x86_64"
matrix:
  include:
    - {os: linux, d: ldc-beta, env: ARCH="x86", addons: {apt: {packages: [[gcc-multilib]]}}}
    - {os: linux, d: ldc, env: ARCH="x86", addons: {apt: {packages: [[gcc-multilib]]}}}
    - {os: linux, d: dmd-beta, env: ARCH="x86", addons: {apt: {packages: [[gcc-multilib]]}}}
    - {os: linux, d: dmd, env: ARCH="x86", addons: {apt: {packages: [[gcc-multilib]]}}}
  allow_failures:
    - {d: dmd-nightly}
    - {d: ldc-beta}
    - {d: gdc}
install:
    - curl -L "https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip" -o ninja-linux.zip
    - sudo unzip ninja-linux.zip -d /usr/local/bin
    - sudo chmod 755 /usr/local/bin/ninja
    - sudo add-apt-repository -y ppa:deadsnakes/ppa
    - sudo apt-get -y update
    - sudo apt-get -y install python3.6
    - curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6
    - sudo pip3 install meson
script:
 - dub test --arch "$ARCH" --build=unittest-cov
 - ./test_examples.sh
 - meson build -D with_test=true && cd build && ninja -j4 && ninja -j4 test -v && cd .. # TODO: 32bit meson test

after_success:
 - bash <(curl -s https://codecov.io/bash)
