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

.travis.yml 2.56 KB
sudo: true
dist: trusty

language: node_js

branches:
  only:
    - master
    - /^greenkeeper/.*$/
  except:
    - /^v\d+\.\d+\.\d+$/

cache: npm

install:
  - npm install -g npm@latest
  - npm install
  - |-
    if [ "$DIALECT" = "postgres-native" ]; then npm install pg-native; fi

env:
  global:
    - SEQ_DB=sequelize_test
    - SEQ_USER=sequelize_test
    - SEQ_PW=sequelize_test
    - SEQ_HOST=127.0.0.1
    - COVERAGE=true

before_script:
  # setup docker
  - "if [ $MARIADB_VER ]; then export MARIADB_ENTRYPOINT=$TRAVIS_BUILD_DIR/test/config/mariadb; fi"
  - "if [ $POSTGRES_VER ] || [ $MARIADB_VER ] || [ $MYSQL_VER ]; then docker-compose up -d ${POSTGRES_VER} ${MARIADB_VER} ${MYSQL_VER}; fi"
  - "if [ $MARIADB_VER ]; then docker run --link ${MARIADB_VER}:db -e CHECK_PORT=3306 -e CHECK_HOST=db --net sequelize_default giorgos/takis; fi"
  - "if [ $MYSQL_VER ]; then docker run --link ${MYSQL_VER}:db -e CHECK_PORT=3306 -e CHECK_HOST=db --net sequelize_default giorgos/takis; fi"
  - "if [ $POSTGRES_VER ]; then docker run --link ${POSTGRES_VER}:db -e CHECK_PORT=5432 -e CHECK_HOST=db --net sequelize_default giorgos/takis; fi"

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

jobs:
  include:
    - stage: lint
      node_js: '8'
      script:
        - npm run lint
        - npm run lint-docs
        - npm run test-typings
    - stage: test
      node_js: '6'
      env: DIALECT=sqlite
    - stage: test
      node_js: '6'
      sudo: required
      env: MARIADB_VER=mariadb-103 SEQ_MARIADB_PORT=8960 DIALECT=mariadb
    - stage: test
      node_js: '6'
      sudo: required
      env: MYSQL_VER=mysql-57 SEQ_MYSQL_PORT=8980 DIALECT=mysql
    - stage: test
      node_js: '6'
      sudo: required
      env: POSTGRES_VER=postgres-10 SEQ_PG_PORT=8991 DIALECT=postgres
    - stage: test
      node_js: '6'
      sudo: required
      env: POSTGRES_VER=postgres-10 SEQ_PG_PORT=8991 SEQ_PG_MINIFY_ALIASES=1 DIALECT=postgres
      script:
        - npm run test-integration
    - stage: test
      node_js: '6'
      sudo: required
      env: POSTGRES_VER=postgres-95 SEQ_PG_PORT=8990 DIALECT=postgres-native
    - stage: release
      node_js: '8'
      script:
        - npm run semantic-release
      before_deploy:
        - npm run docs
        - npm run docs-routing
      deploy:
        provider: surge
        project: ./esdoc/
        domain: docs.sequelizejs.com
        skip_cleanup: true

stages:
  - lint
  - test
  - name: release
    if: branch = master AND type = push AND fork = false