0
Fork 0
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:
Hannah Wolfe 2019-03-11 15:43:47 +00:00
parent cc84f6d6a1
commit 9efc06255f
3 changed files with 15 additions and 15 deletions

View file

@ -24,10 +24,10 @@ matrix:
- node_js: "10"
env: TEST_SUITE=lint
fast_finish: true
branches:
except:
- /^renovate\/.+$/
branches:
except:
- /^renovate\/.+$/
before_install:
- 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
script: |
if [[ ( "$TRAVIS_PULL_REQUEST_BRANCH" =~ ^renovate || "$TRAVIS_EVENT_TYPE" == "cron" ) && "$TEST_SUITE" != "lint" ]]; then
yarn test:regression
if [ "$TEST_SUITE" == "lint" ]
yarn lint
elif [[ "$TRAVIS_PULL_REQUEST_BRANCH" =~ ^renovate || "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
yarn ci:regression
else
yarn test
yarn ci
fi
after_failure: |

View file

@ -473,12 +473,8 @@ const configureGrunt = function (grunt) {
// **Main testing task**
//
// `grunt validate` will either run all tests or run linting
// `grunt validate` is called by `npm test` and is used by Travis.
grunt.registerTask('validate', 'Run tests or lint code', function () {
if (process.env.TEST_SUITE === 'lint') {
return grunt.task.run(['lint']);
}
// `grunt validate` is called by `yarn test` and is used by Travis.
grunt.registerTask('validate', 'Run tests', function () {
grunt.task.run(['test-acceptance', 'test-unit']);
});

View file

@ -23,12 +23,14 @@
"scripts": {
"start": "node index",
"dev": "DEBUG=ghost:* grunt dev",
"test": "grunt validate --verbose",
"test:regression": "grunt test-regression --verbose",
"test": "grunt validate",
"ci": "grunt validate --verbose",
"ci:regression": "grunt test-regression --verbose",
"setup": "yarn install && knex-migrator init && grunt symlink && grunt init || true",
"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": "yarn lint:server && yarn lint:test",
"posttest": "yarn lint",
"fixmodulenotdefined": "yarn cache clean && cd core/client && rm -rf node_modules tmp dist && yarn && cd ../../"
},
"engines": {