language: php
php:
  - '7.3'
env:
  global:
    - MOZ_HEADLESS=1
sudo: required
dist: bionic
addons:
  firefox: '83.0'
services:
  - xvfb
  - mysql
  - memcached
before_install:
  - phpenv config-rm xdebug.ini
  - mysql -e 'create database fusio;'
install:
  - composer create-project fusio/fusio fusio dev-master
  - npm install
  - node node_modules/grunt-cli/bin/grunt
  - node node_modules/.bin/webdriver-manager update
before_script:
  - cp .env fusio/.env
  - cp server.php fusio/public/server.php
  - mkdir fusio/public/fusio/
  - cp -r dist fusio/public/fusio/dist/
  - cp -r fonts fusio/public/fusio/fonts/
  - cp -r help fusio/public/fusio/help/
  - cp -r img fusio/public/fusio/img/
  - sed -i 's/\${API_URL}/http:\/\/127.0.0.1:8008\//g' index.html
  - cp index.html fusio/public/fusio/index.html
  - pushd fusio/public
  - php server.php --warmup
  - (php -S 127.0.0.1:8008 server.php) &
  - popd
  - (node node_modules/.bin/webdriver-manager start > /dev/null 2>&1) &
  - sleep 12
script:
  - node node_modules/protractor/bin/protractor tests/conf.js
