language: cpp
dist: xenial
git:
  submodules: false
addons:
  ssh_known_hosts:
  - github.com
  apt:
   # sources:
   #   - ubuntu-toolchain-r-test
    packages:
    #  - gcc-6
    #  - g++-6
      - libevent-dev
      - libsqlite3-dev
env:
- DATABASE_FILE=cards.cdb

before_install:
- git submodule update --init --recursive
#- sudo ln -s /usr/bin/gcc-6 /usr/local/bin/gcc
#- sudo ln -s /usr/bin/g++-6 /usr/local/bin/g++
#- g++ --version
- wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz | tar zfx -
script:
- ./premake5 gmake
- cd build
- make config=release

- cd ..
- mv -f ./bin/release/ygopro .
- strip ygopro
- mkdir replay

- echo "select id from datas;" | sqlite3 $DATABASE_FILE | xargs -I {} ./ygopro {} 2>&1 | tee ./redtext.txt
- bash -c "exit $(cat ./redtext.txt | wc -l)"
