Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip testing for PR builds and non-lockfile push builds on greenkeeper branches #13025

Merged
merged 3 commits into from Jan 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions build-system/pr-check.js
Expand Up @@ -410,6 +410,24 @@ function main() {
colors.cyan(process.env.BUILD_SHARD),
'\n');

// Eliminate unnecessary testing on greenkeeper branches by running tests only
// on the push build that contains the lockfile update.
const isGreenkeeperPushBuild =
((process.env.TRAVIS_EVENT_TYPE == 'push') &&
(process.env.TRAVIS_BRANCH.indexOf('greenkeeper/') != -1));
const isGreenkeeperPrBuild =
((process.env.TRAVIS_EVENT_TYPE == 'pull_request') &&
(process.env.TRAVIS_PULL_REQUEST_BRANCH.indexOf('greenkeeper/') != -1));
if (isGreenkeeperPrBuild ||
(isGreenkeeperPushBuild &&
process.env.TRAVIS_COMMIT_MESSAGE.indexOf('update lockfile') == -1)) {
console.log(fileLogPrefix,
'Skipping unnecessary testing on greenkeeper branches. ' +
'Tests will only be run for the push build with the lockfile update.');
stopTimer('pr-check.js', startTime);
return 0;
}

// If $TRAVIS_PULL_REQUEST_SHA is empty then it is a push build and not a PR.
if (!process.env.TRAVIS_PULL_REQUEST_SHA) {
console.log(fileLogPrefix, 'Running all commands on push build.');
Expand Down