mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-29 21:52:22 +01:00
Merge pull request #13623 from twbs/skip-ci-steps
add [skip sauce] and [skip validator]
This commit is contained in:
commit
082bc20bb9
@ -6,13 +6,16 @@ before_install:
|
|||||||
- rvm use 1.9.3 --fuzzy
|
- rvm use 1.9.3 --fuzzy
|
||||||
- export GEMDIR=$(rvm gemdir)
|
- export GEMDIR=$(rvm gemdir)
|
||||||
- if [ "$TWBS_TEST" = validate-html ]; then echo "ruby=$(basename $GEMDIR) jekyll=$JEKYLL_VERSION" > pseudo_Gemfile.lock; fi
|
- if [ "$TWBS_TEST" = validate-html ]; then echo "ruby=$(basename $GEMDIR) jekyll=$JEKYLL_VERSION" > pseudo_Gemfile.lock; fi
|
||||||
|
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""
|
||||||
|
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip validator\]'; export TWBS_DO_VALIDATOR=$?; true
|
||||||
|
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip sauce\]'; export TWBS_DO_SAUCE=$?; true
|
||||||
install:
|
install:
|
||||||
- time npm install -g grunt-cli
|
- time npm install -g grunt-cli
|
||||||
- ./test-infra/s3_cache.py download npm-modules
|
- ./test-infra/s3_cache.py download npm-modules
|
||||||
- if [ "$TWBS_TEST" = validate-html ]; then ./test-infra/s3_cache.py download rubygems; fi
|
- if [ "$TWBS_TEST" = validate-html ] && [ $TWBS_DO_VALIDATOR -ne 0 ]; then ./test-infra/s3_cache.py download rubygems; fi
|
||||||
after_script:
|
after_script:
|
||||||
- if [ "$TWBS_TEST" = core ]; then ./test-infra/s3_cache.py upload npm-modules; fi
|
- if [ "$TWBS_TEST" = core ]; then ./test-infra/s3_cache.py upload npm-modules; fi
|
||||||
- if [ "$TWBS_TEST" = validate-html ]; then ./test-infra/s3_cache.py upload rubygems; fi
|
- if [ "$TWBS_TEST" = validate-html ] && [ $TWBS_DO_VALIDATOR -ne 0 ]; then ./test-infra/s3_cache.py upload rubygems; fi
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- JEKYLL_VERSION: 1.5.0
|
- JEKYLL_VERSION: 1.5.0
|
||||||
|
17
Gruntfile.js
17
Gruntfile.js
@ -401,20 +401,31 @@ module.exports = function (grunt) {
|
|||||||
// Docs HTML validation task
|
// Docs HTML validation task
|
||||||
grunt.registerTask('validate-html', ['jekyll', 'validation']);
|
grunt.registerTask('validate-html', ['jekyll', 'validation']);
|
||||||
|
|
||||||
|
var runSubset = function (subset) {
|
||||||
|
return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset;
|
||||||
|
};
|
||||||
|
var isUndefOrNonZero = function (val) {
|
||||||
|
return val === undefined || val !== '0';
|
||||||
|
};
|
||||||
|
|
||||||
// Test task.
|
// Test task.
|
||||||
var testSubtasks = [];
|
var testSubtasks = [];
|
||||||
// Skip core tests if running a different subset of the test suite
|
// Skip core tests if running a different subset of the test suite
|
||||||
if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'core') {
|
if (runSubset('core')) {
|
||||||
testSubtasks = testSubtasks.concat(['dist-css', 'csslint', 'jshint', 'jscs', 'qunit', 'build-customizer-html']);
|
testSubtasks = testSubtasks.concat(['dist-css', 'csslint', 'jshint', 'jscs', 'qunit', 'build-customizer-html']);
|
||||||
}
|
}
|
||||||
// Skip HTML validation if running a different subset of the test suite
|
// Skip HTML validation if running a different subset of the test suite
|
||||||
if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'validate-html') {
|
if (runSubset('validate-html') &&
|
||||||
|
// Skip HTML5 validator on Travis when [skip validator] is in the commit message
|
||||||
|
isUndefOrNonZero(process.env.TWBS_DO_VALIDATOR)) {
|
||||||
testSubtasks.push('validate-html');
|
testSubtasks.push('validate-html');
|
||||||
}
|
}
|
||||||
// Only run Sauce Labs tests if there's a Sauce access key
|
// Only run Sauce Labs tests if there's a Sauce access key
|
||||||
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
|
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
|
||||||
// Skip Sauce if running a different subset of the test suite
|
// Skip Sauce if running a different subset of the test suite
|
||||||
(!process.env.TWBS_TEST || process.env.TWBS_TEST === 'sauce-js-unit')) {
|
runSubset('sauce-js-unit') &&
|
||||||
|
// Skip Sauce on Travis when [skip sauce] is in the commit message
|
||||||
|
isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) {
|
||||||
testSubtasks.push('connect');
|
testSubtasks.push('connect');
|
||||||
testSubtasks.push('saucelabs-qunit');
|
testSubtasks.push('saucelabs-qunit');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user