language: elixir
elixir: 1.4.2
otp_release: 19.0
sudo: false
dist: trusty
addons:
  postgresql: "9.6"
services:
  - postgresql
env:
  global:
    - MIX_ENV=test
before_script:
  - psql -U postgres -c 'CREATE DATABASE diskusi_data_test;'
  - cp tools/travis/test.exs config/test.exs

###
# File     : .travis.yml
# License  :
#   Copyright (c) 2017 Herdy Handoko
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
###

# Configure Travis build environment and use PostgreSQL 9.6
# See: https://docs.travis-ci.com/user/database-setup/#Using-a-different-PostgreSQL-Version
# ~~~~~~
sudo: false
dist: trusty
addons:
  postgresql: "9.6"
services:
  - postgresql

# Set Elixir and OTP versions
# ~~~~~~
language: elixir
elixir: 1.4.2
otp_release: 19.0

# Use test context
# ~~~~~~
env:
  global:
    - MIX_ENV=test

# Configure dependencies
# See:
#   - https://docs.travis-ci.com/user/languages/elixir/#Default-commands
#   - https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#Travis-CI-uses-npm
# ~~~~~~
install:
  - mix local.rebar --force # for Elixir 1.3.0 and up
  - mix local.hex --force
  - mix deps.get
  - npm install

# Create test database and copy test configuration
# ~~~~~~
before_script:
  - psql -U postgres -c 'CREATE DATABASE diskusi_data_test;'
  - cp tools/travis/test.exs config/test.exs

Add `npm` dependencies installation in `install` task
Add `npm` dependencies installation in `install` task
