Ghost/.travis.yml
Kevin Ansfield a102eff0ed Separate the server/client/lint test suites on Travis
no issue
- add separate grunt tasks for validating all/client/server test suites
- modify `grunt validate` to respect the `TEST_SUITE` env var if present
- default to `TEST_SUITE=server` on Travis
- add an individual builds to the Travis matrix that test the client and run linting as separate jobs
- don't run `ensureConfig` task if we're performing client-only tests

Previously we were duplicating the client tests and linting for every node and database version in our build matrix. Duplicating those tasks a waste of time/resources as the client tests are now completely isolated from the server and so different node/database versions have no effect. This PR is an attempt at removing the duplication to speed up our Travis runs.
2015-11-30 15:21:08 +00:00

55 lines
1.5 KiB
YAML

language: node_js
# When changing node version also update it on line 35.
node_js:
- "0.10"
- "0.12"
- "4.2"
sudo: false
cache:
directories:
- node_modules
- core/client/node_modules
- core/client/bower_components
addons:
postgresql: "9.3"
env:
global:
- GITHUB_OAUTH_KEY=003a44d58f12089d0c0261338298af3813330949
- GHOST_NODE_VERSION_CHECK=false
- TEST_SUITE=server
matrix:
- DB=sqlite3 NODE_ENV=testing
- DB=mysql NODE_ENV=testing-mysql
- DB=pg NODE_ENV=testing-pg
matrix:
include:
- node_js: "0.10"
env: TEST_SUITE=client
- node_js: "0.10"
env: TEST_SUITE=lint
before_install:
- git clone git://github.com/n1k0/casperjs.git ~/casperjs
- cd ~/casperjs
- git checkout tags/1.1-beta3
- export PATH=$PATH:`pwd`/bin
- cd -
- if [ $DB == "mysql" ]; then mysql -e 'create database ghost_testing'; fi
- if [ $DB == "pg" ]; then psql -c 'create database ghost_testing;' -U postgres; fi
before_script:
- phantomjs --version
- casperjs --version
after_success:
- |
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
if [[ "$DB" = "sqlite3" && "$TRAVIS_NODE_VERSION" = "0.10" ]]; then
echo "Generate coverage..."
grunt coverage
npm install -g codeclimate-test-reporter
codeclimate-test-reporter < core/test/coverage/unit/lcov.info
else
echo "False DB and NODE_VERSION. No coverage generated."
fi
else
echo "This is a PR. No coverage generated."
fi