This patch adds the gulp command of `validate-commit-messages` which will validate the range of commits messages present in the active branch. This check now runs on CI as part of the linting checks. Allowed commit message types and scopes are controlled via commit-message.json file and documented at https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines This solution is based on old Vojta's code that he wrote for angular/angular.js, that was later adjusted by @matsko in #13815. Ideally we should switch over to something like https://www.npmjs.com/package/commitplease as suggested in #9953 but that package currently doesn't support strict scope checking, which is one of the primarily goal of this PR. Note that this PR removes support for "chore" which was previously overused by everyone on the team. Closes #13815 Fixes #3337
57 lines
1.2 KiB
Bash
Executable File
57 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -ex -o pipefail
|
|
|
|
if [[ ${TRAVIS} && ${CI_MODE} != "js" ]]; then
|
|
exit 0;
|
|
fi
|
|
|
|
|
|
echo 'travis_fold:start:test.js'
|
|
|
|
# Setup environment
|
|
cd `dirname $0`
|
|
source ./env.sh
|
|
cd ../..
|
|
|
|
|
|
echo 'travis_fold:start:test.unit.tools'
|
|
|
|
# Run unit tests in tools
|
|
node ./dist/tools/tsc-watch/ tools runCmdsOnly
|
|
|
|
cd tools/validate-commit-message
|
|
$(npm bin)/jasmine
|
|
cd -
|
|
|
|
echo 'travis_fold:end:test.unit.tools'
|
|
|
|
|
|
echo 'travis_fold:start:test.unit.node'
|
|
|
|
# Run unit tests in node
|
|
node ./dist/tools/tsc-watch/ node runCmdsOnly
|
|
|
|
echo 'travis_fold:end:test.unit.node'
|
|
|
|
|
|
echo 'travis_fold:start:test.unit.localChrome'
|
|
|
|
# rebuild to revert files in @angular/compiler/test
|
|
# TODO(tbosch): remove this and teach karma to serve the right files
|
|
node dist/tools/@angular/tsc-wrapped/src/main -p modules/tsconfig.json
|
|
|
|
# Run unit tests in local chrome
|
|
if [[ ${TRAVIS} ]]; then
|
|
sh -e /etc/init.d/xvfb start
|
|
fi
|
|
|
|
$(npm bin)/karma start ./karma-js.conf.js --single-run --browsers=${KARMA_JS_BROWSERS}
|
|
|
|
$(npm bin)/karma start ./modules/@angular/router/karma.conf.js --single-run --browsers=${KARMA_JS_BROWSERS}
|
|
|
|
echo 'travis_fold:end:test.unit.localChrome'
|
|
|
|
|
|
echo 'travis_fold:end:test.js'
|