language: cpp
dist: bionic
git:
  submodules: false
addons:
  ssh_known_hosts:
  - github.com
  apt:
   # sources:
   #   - ubuntu-toolchain-r-test
    packages:
    #  - gcc-6
    #  - g++-6
      - libevent-dev
      - libsqlite3-dev
      - liblua5.3-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-alpha14/premake-5.0.0-alpha14-linux.tar.gz | tar zfx -
#- wget -O - https://www.lua.org/ftp/lua-5.3.5.tar.gz | tar zfx -; cd lua-5.3.5; sudo make linux install; cd ..
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)"
