2019-03-11 16:46:48 +00:00
|
|
|
dist: xenial
|
2013-05-12 21:15:35 +01:00
|
|
|
language: node_js
|
|
|
|
node_js:
|
2019-06-17 23:44:23 +02:00
|
|
|
- '12'
|
2019-03-11 21:41:55 +00:00
|
|
|
- '10'
|
|
|
|
- '8'
|
2019-03-11 16:46:48 +00:00
|
|
|
cache: yarn
|
|
|
|
services:
|
2019-03-11 21:41:55 +00:00
|
|
|
- mysql
|
2019-04-18 13:35:41 +01:00
|
|
|
# Don't run builds for renovate PRs
|
|
|
|
if: NOT head_branch =~ ^renovate
|
2013-10-29 20:54:37 +00:00
|
|
|
env:
|
2015-01-07 20:44:14 +00:00
|
|
|
matrix:
|
2019-03-11 21:41:55 +00:00
|
|
|
- DB=sqlite3 NODE_ENV=testing
|
|
|
|
- DB=mysql NODE_ENV=testing-mysql
|
2015-11-13 11:54:50 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
2019-03-11 21:41:55 +00:00
|
|
|
- node_js: '10'
|
|
|
|
env: TEST_SUITE=lint
|
2019-06-17 23:44:23 +02:00
|
|
|
allow_failures:
|
|
|
|
- node_js: '12'
|
2017-01-23 10:32:49 -05:00
|
|
|
install:
|
2019-06-18 00:00:03 +02:00
|
|
|
- if [ "$TRAVIS_NODE_VERSION" == "12" ]; then yarn --ignore-engines; else yarn; fi
|
2019-03-11 16:46:48 +00:00
|
|
|
before_script:
|
2019-03-11 21:41:55 +00:00
|
|
|
- if [ $DB == "mysql" ]; then mysql -e 'create database ghost_testing'; fi
|
2019-06-18 00:00:03 +02:00
|
|
|
- if [ "$DB" == "sqlite3" ]; then yarn add --ignore-engines --force sqlite3; fi
|
2019-01-22 18:31:07 +01:00
|
|
|
script: |
|
2019-03-11 16:39:17 +00:00
|
|
|
if [ "$TEST_SUITE" == "lint" ]; then
|
2019-03-11 15:43:47 +00:00
|
|
|
yarn lint
|
|
|
|
elif [[ "$TRAVIS_PULL_REQUEST_BRANCH" =~ ^renovate || "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
|
|
|
|
yarn ci:regression
|
2019-01-22 18:31:07 +01:00
|
|
|
else
|
2019-03-11 15:43:47 +00:00
|
|
|
yarn ci
|
2019-01-22 18:31:07 +01:00
|
|
|
fi
|
2019-09-23 12:29:11 +05:30
|
|
|
after_failure: |
|
|
|
|
if [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
|
|
|
|
curl -X POST --data-urlencode "payload={\"attachments\": [{\"color\": \"danger\", \"fallback\": \"Build Failure: $TRAVIS_JOB_WEB_URL\", \"title\": \"Build Failure\", \"text\": \"$TRAVIS_JOB_WEB_URL\"}]}" $SLACK_URL
|
|
|
|
fi
|