不要怂,就是干,撸起袖子干!

.travis.yml 1.04 KB
sudo: required
dist: trusty

language: node_js

node_js:
  - "4"
  - "6"

branches:
  only:
  - master
  - v3

env:
  global:
    # mysql info
    - SEQ_MYSQL_DB: sequelize_test
    - SEQ_MYSQL_USER: sequelize_test
    - SEQ_MYSQL_PW: sequelize_test
    - SEQ_MYSQL_HOST: 127.0.0.1
    - SEQ_MYSQL_PORT: 8998
    # postgres info
    - SEQ_PG_DB: sequelize_test
    - SEQ_PG_USER: sequelize_test
    - SEQ_PG_PW: sequelize_test
    - SEQ_PG_HOST: 127.0.0.1
    - SEQ_PG_PORT: 8999

  matrix:
    - DIALECT=sqlite COVERAGE=true
    - MYSQL_VER=mysql-57 DIALECT=mysql COVERAGE=true
    - POSTGRES_VER=postgres-95 DIALECT=postgres COVERAGE=true
    - POSTGRES_VER=postgres-95 DIALECT=postgres-native COVERAGE=true

before_script:
  - "if [ $POSTGRES_VER ] || [ $MYSQL_VER ]; then docker-compose up -d ${POSTGRES_VER} ${MYSQL_VER}; fi"
  - "sleep 30s" # This allows enough time for docker to get up and running before tests occur

script:
  - "if [ $COVERAGE ]; then npm run cover && bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info; else npm run test; fi"