mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Simplify lint build in travis & grunt
refs #9441 - We have logic in travis and in grunt and in package.json, this simplifies things. - `grunt lint` is now just an alias
This commit is contained in:
parent
cc84f6d6a1
commit
9efc06255f
3 changed files with 15 additions and 15 deletions
16
.travis.yml
16
.travis.yml
|
@ -24,10 +24,10 @@ matrix:
|
||||||
- node_js: "10"
|
- node_js: "10"
|
||||||
env: TEST_SUITE=lint
|
env: TEST_SUITE=lint
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
except:
|
except:
|
||||||
- /^renovate\/.+$/
|
- /^renovate\/.+$/
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- if [ $DB == "mysql" ]; then mysql -e 'create database ghost_testing'; fi
|
- if [ $DB == "mysql" ]; then mysql -e 'create database ghost_testing'; fi
|
||||||
|
@ -41,10 +41,12 @@ install:
|
||||||
- if [ "$DB" == "sqlite3" ]; then yarn add --force sqlite3; fi # fix sqlite caching issues
|
- if [ "$DB" == "sqlite3" ]; then yarn add --force sqlite3; fi # fix sqlite caching issues
|
||||||
|
|
||||||
script: |
|
script: |
|
||||||
if [[ ( "$TRAVIS_PULL_REQUEST_BRANCH" =~ ^renovate || "$TRAVIS_EVENT_TYPE" == "cron" ) && "$TEST_SUITE" != "lint" ]]; then
|
if [ "$TEST_SUITE" == "lint" ]
|
||||||
yarn test:regression
|
yarn lint
|
||||||
|
elif [[ "$TRAVIS_PULL_REQUEST_BRANCH" =~ ^renovate || "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
|
||||||
|
yarn ci:regression
|
||||||
else
|
else
|
||||||
yarn test
|
yarn ci
|
||||||
fi
|
fi
|
||||||
|
|
||||||
after_failure: |
|
after_failure: |
|
||||||
|
|
|
@ -473,12 +473,8 @@ const configureGrunt = function (grunt) {
|
||||||
// **Main testing task**
|
// **Main testing task**
|
||||||
//
|
//
|
||||||
// `grunt validate` will either run all tests or run linting
|
// `grunt validate` will either run all tests or run linting
|
||||||
// `grunt validate` is called by `npm test` and is used by Travis.
|
// `grunt validate` is called by `yarn test` and is used by Travis.
|
||||||
grunt.registerTask('validate', 'Run tests or lint code', function () {
|
grunt.registerTask('validate', 'Run tests', function () {
|
||||||
if (process.env.TEST_SUITE === 'lint') {
|
|
||||||
return grunt.task.run(['lint']);
|
|
||||||
}
|
|
||||||
|
|
||||||
grunt.task.run(['test-acceptance', 'test-unit']);
|
grunt.task.run(['test-acceptance', 'test-unit']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,14 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node index",
|
"start": "node index",
|
||||||
"dev": "DEBUG=ghost:* grunt dev",
|
"dev": "DEBUG=ghost:* grunt dev",
|
||||||
"test": "grunt validate --verbose",
|
"test": "grunt validate",
|
||||||
"test:regression": "grunt test-regression --verbose",
|
"ci": "grunt validate --verbose",
|
||||||
|
"ci:regression": "grunt test-regression --verbose",
|
||||||
"setup": "yarn install && knex-migrator init && grunt symlink && grunt init || true",
|
"setup": "yarn install && knex-migrator init && grunt symlink && grunt init || true",
|
||||||
"lint:server": "eslint --ignore-path .eslintignore 'core/server/**/*.js' 'core/*.js' '*.js'",
|
"lint:server": "eslint --ignore-path .eslintignore 'core/server/**/*.js' 'core/*.js' '*.js'",
|
||||||
"lint:test": "eslint -c core/test/.eslintrc.json --ignore-path core/test/.eslintignore 'core/test/**/*.js'",
|
"lint:test": "eslint -c core/test/.eslintrc.json --ignore-path core/test/.eslintignore 'core/test/**/*.js'",
|
||||||
"lint": "yarn lint:server && yarn lint:test",
|
"lint": "yarn lint:server && yarn lint:test",
|
||||||
|
"posttest": "yarn lint",
|
||||||
"fixmodulenotdefined": "yarn cache clean && cd core/client && rm -rf node_modules tmp dist && yarn && cd ../../"
|
"fixmodulenotdefined": "yarn cache clean && cd core/client && rm -rf node_modules tmp dist && yarn && cd ../../"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue