inocode:
  image: "java:8"
  variables:
      ESPURL:    "http://arduino.esp8266.com/stable/package_esp8266com_index.json"
      MEMORY:    "custom_FlashSize=nodemcuv2_4M3M"
      INSTBOARD: "esp8266:esp8266"
      BOARD:     "${INSTBOARD}:nodemcuv2"
  before_script:
      - cd /
      - wget --quiet "https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz" -O "arduino-nightly-linux64.tar.xz"
      - tar axf "arduino-nightly-linux64.tar.xz"
      - /arduino-nightly/arduino --pref "boardsmanager.additional.urls=${ESPURL}"
      - /arduino-nightly/arduino --install-boards "${INSTBOARD}"
  script:
      - cd "${CI_PROJECT_DIR}/arduino/${CI_PROJECT_NAME}"
      - cp "${CI_PROJECT_NAME}.example.h" "${CI_PROJECT_NAME}.h"
      - /arduino-nightly/arduino --install-library "FastLED"
      - /arduino-nightly/arduino --install-library "PubSubClient"
      - /arduino-nightly/arduino --pref "${MEMORY}" --board "${BOARD}" --verify "${CI_PROJECT_NAME}.ino"

yaml:
  image: "python:alpine"
  before_script:
      - pip install "PyYAML"
  script:
      - cd "${CI_PROJECT_DIR}/home-assistant"
      - python -c "from yaml import load, Loader; load(open('configuration.yaml'), Loader=Loader)"
