general:
  artifacts:
  - emcc/drafter.js
  - emcc/drafter.js.mem

machine:
  services:
    - docker
  node:
    version: 0.10.34

checkout:
  post:
    - git submodule update --init --recursive

dependencies:
  cache_directories:
    - "~/docker"
  pre:
    - if [[ ! -f ~/docker/emscripten.tar ]]; then mkdir -p ~/docker &&
      docker pull "apiaryio/base-emscripten-dev" &&
      docker save "apiaryio/base-emscripten-dev" > ~/docker/emscripten.tar;
      else docker load -i ~/docker/emscripten.tar; fi
    - npm install

test:
  pre:
    - ./configure -i
  override:
    - env CXXFLAGS="-Werror" make test
    - docker run -v $(pwd):/src -t apiaryio/base-emscripten-dev emcc/emcbuild.sh
    - npm test

deployment:
  release:
    tag: /v.*/
    commands:
      - ./tools/release.sh

general:
  artifacts:
  - emcc/drafter.js
  - emcc/drafter.js.mem
  - memcheck.log

machine:
  services:
    - docker
  node:
    version: 0.10.34

checkout:
  post:
    - git submodule update --init --recursive

dependencies:
  cache_directories:
    - "~/docker"
  pre:
    - sudo apt-get install valgrind
    - if [[ ! -f ~/docker/emscripten.tar ]]; then mkdir -p ~/docker &&
      docker pull "apiaryio/base-emscripten-dev" &&
      docker save "apiaryio/base-emscripten-dev" > ~/docker/emscripten.tar;
      else docker load -i ~/docker/emscripten.tar; fi
    - npm install

test:
  pre:
    - ./configure -i
  override:
    - env CXXFLAGS="-Werror" make test
    - valgrind --leak-check=full --show-leak-kinds=definite,indirect,possible --error-exitcode=1 ./bin/test-libdrafter 2> memcheck.log
    - docker run -v $(pwd):/src -t apiaryio/base-emscripten-dev emcc/emcbuild.sh
    - npm test


deployment:
  release:
    tag: /v.*/
    commands:
      - ./tools/release.sh

Add valgrind memcheck to CI test
Add valgrind memcheck to CI test
