Skip to content

Commit a97b174

Browse files
committed
Setting up Travis CI
1 parent 5e1d632 commit a97b174

File tree

5 files changed

+89
-48
lines changed

5 files changed

+89
-48
lines changed

.travis.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ language: node_js
22
node_js:
33
- 0.8
44
before_script:
5+
- gem install sass
6+
- gem install compass
7+
- gem install nokiri
58
- gem install jekyll
69
- npm install -g grunt-cli
7-
env:
8-
global:
9-
- secure: Besg41eyU+2mfxrywQ4ydOShMdc34ImaO0S0ENP+aCOBuyNBIgP59wy5tBMmyai2/8eInYeVps4Td96mWInMMxzTe3Bar7eTLG5tWVKRSr/wc4NBPZ/ppoPAmCEsz9Y+VptRH9/FO8n7hsL9EFZ+xBKbG+C0SccGoyBDpA5j7/w=
10-
- secure: Ptiv7phCImFP3ALIz+sMQzrZg8k7C1gLZbFBhWxjnQr3g06wIfX3Ls5y9OHvxid+lOZZjISui3wzBVgpVHqwHUYf96+r0mo6/mJ+F4ffUmShZANVaIMD/JRTnXhUQJbvntGLvxn1EYWPdNM+2IHJrMipnjHxU9tkgAnlel4Zdew=
11-
- TWBS_HAVE_OWN_BROWSERSTACK_KEY: ""
10+
- npm install
11+
script:
12+
- grunt
13+
# env:
14+
# global:
15+
# - secure: Besg41eyU+2mfxrywQ4ydOShMdc34ImaO0S0ENP+aCOBuyNBIgP59wy5tBMmyai2/8eInYeVps4Td96mWInMMxzTe3Bar7eTLG5tWVKRSr/wc4NBPZ/ppoPAmCEsz9Y+VptRH9/FO8n7hsL9EFZ+xBKbG+C0SccGoyBDpA5j7/w=
16+
# - secure: Ptiv7phCImFP3ALIz+sMQzrZg8k7C1gLZbFBhWxjnQr3g06wIfX3Ls5y9OHvxid+lOZZjISui3wzBVgpVHqwHUYf96+r0mo6/mJ+F4ffUmShZANVaIMD/JRTnXhUQJbvntGLvxn1EYWPdNM+2IHJrMipnjHxU9tkgAnlel4Zdew=
17+
# - TWBS_HAVE_OWN_BROWSERSTACK_KEY: ""

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ As of v3.0.0, Saas Bootstrap's documentation is powered by Jekyll templates and
3131

3232
## Pull requests
3333

34-
- Try to submit pull requests against the latest `*sass-wip` branch for easier merging
34+
- CSS changes must be done in `.less` files first, never just the compiled `.css` files
3535
- If modifying the `.scss` files, always recompile and commit the compiled file `sass-bootstrap.css`
36+
- Always submit pull requests against the latest `*sass-wip` branch for easier merging
3637
- Try not to pollute your pull request with unintended changes--keep them simple and small
3738
- Try to share which browsers your code has been tested in before submitting a pull request
3839

Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'sass', '3.2.12'
4+
gem 'compass', '0.12.2'
5+
gem 'nokogiri'
6+
gem 'jekyll', '1.1.2'
7+
gem 'rdiscount'
8+
gem 'rb-fsevent'
9+
gem 'rake'

Gruntfile.js

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module.exports = function(grunt) {
1414

1515
modules.livereload = require('./assets/js/grunts/livereload')(modules);
1616

17+
RegExp.quote = require('regexp-quote')
18+
1719
// Project configuration.
1820
grunt.initConfig({
1921

@@ -26,11 +28,11 @@ module.exports = function(grunt) {
2628
'*\n' +
2729
'* Designed and built with all the love in the world by @alademann, @mdo and @fat.\n' +
2830
'*/\n',
29-
jqueryCheck: 'if (!jQuery) { throw new Error(\"Sass Bootstrap requires jQuery\") }\n\n',
31+
jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error(\"Sass Bootstrap requires jQuery\") }\n\n',
3032

3133
// Task configuration.
3234
clean: {
33-
dist: ['dist', '<%= pkg.name %>-dist.zip']
35+
dist: ['dist', '_gh_pages', '<%= pkg.name %>-dist.zip']
3436
},
3537

3638
jshint: {
@@ -80,7 +82,8 @@ module.exports = function(grunt) {
8082

8183
uglify: {
8284
options: {
83-
banner: '<%= banner %>'
85+
banner: '<%= banner %>',
86+
report: 'min'
8487
},
8588
bootstrap: {
8689
src: ['<%= concat.bootstrap.dest %>'],
@@ -174,7 +177,12 @@ module.exports = function(grunt) {
174177

175178
validation: {
176179
options: {
177-
reset: false
180+
reset: true,
181+
maxTry: 1,
182+
relaxerror: [
183+
"Bad value X-UA-Compatible for attribute http-equiv on element meta.",
184+
"Element img is missing required attribute src.",
185+
]
178186
},
179187
files: {
180188
src: ["_gh_pages/**/*.html"]
@@ -234,43 +242,57 @@ module.exports = function(grunt) {
234242
livereload: true
235243
}
236244
}
245+
},
246+
247+
sed: {
248+
versionNumber: {
249+
pattern: (function () {
250+
var old = grunt.option('oldver')
251+
return old ? RegExp.quote(old) : old
252+
})(),
253+
replacement: grunt.option('newver'),
254+
recursive: true
255+
}
237256
}
238257
});
239258

240259

241260
// These plugins provide necessary tasks.
242-
grunt.loadNpmTasks('grunt-contrib-connect');
261+
// grunt.loadNpmTasks('browserstack-runner');
243262
grunt.loadNpmTasks('grunt-contrib-clean');
244-
grunt.loadNpmTasks('grunt-contrib-compass');
263+
grunt.loadNpmTasks('grunt-contrib-compress');
264+
grunt.loadNpmTasks('grunt-css');
245265
grunt.loadNpmTasks('grunt-contrib-cssmin');
246266
grunt.loadNpmTasks('grunt-contrib-concat');
247-
grunt.loadNpmTasks('grunt-contrib-compress');
267+
grunt.loadNpmTasks('grunt-contrib-connect');
248268
grunt.loadNpmTasks('grunt-contrib-copy');
249269
grunt.loadNpmTasks('grunt-contrib-jshint');
250270
grunt.loadNpmTasks('grunt-contrib-qunit');
251271
grunt.loadNpmTasks('grunt-contrib-uglify');
252272
grunt.loadNpmTasks('grunt-contrib-watch');
253273
grunt.loadNpmTasks('grunt-html-validation');
254-
grunt.loadNpmTasks('grunt-css');
255274
grunt.loadNpmTasks('grunt-jekyll');
275+
grunt.loadNpmTasks('grunt-contrib-compass');
276+
grunt.loadNpmTasks('grunt-sed');
277+
256278

257279
grunt.registerTask('lr', modules.livereload);
258280

259281
// Docs HTML validation task
260-
grunt.registerTask('validate-html', ['jekyll', 'validation']);
282+
grunt.registerTask('validate-html', ['clean', 'jekyll', 'validation']);
261283

262284
// Test task.
263-
grunt.registerTask('testSubtasks', ['jshint', 'qunit', 'validate-html']);
264-
grunt.registerTask('testSubtasksNoValidation', ['jshint', 'qunit']);
265-
grunt.registerTask('test',
266-
function() {
267-
if(grunt.option('validate')) {
268-
grunt.task.run('testSubtasks');
269-
} else {
270-
grunt.task.run('testSubtasksNoValidation');
271-
}
272-
}
273-
);
285+
var testSubtasks = ['dist-css', 'jshint', 'qunit', 'validate-html'];
286+
var testSubtasksNoHTMLValidation = ['dist-css', 'jshint', 'qunit'];
287+
// Only run BrowserStack tests under Travis
288+
// if (process.env.TRAVIS) {
289+
// // Only run BrowserStack tests if this is a mainline commit in twbs/bootstrap, or you have your own BrowserStack key
290+
// if ((process.env.TRAVIS_REPO_SLUG === 'alademann/sass-bootstrap' && process.env.TRAVIS_PULL_REQUEST === 'false') || process.env.ALADEMANN_HAVE_OWN_BROWSERSTACK_KEY) {
291+
// testSubtasks.push('browserstack_runner');
292+
// }
293+
// }
294+
grunt.registerTask('test', testSubtasks);
295+
grunt.registerTask('test-no-html', testSubtasksNoHTMLValidation);
274296

275297
// JS distribution task.
276298
grunt.registerTask('dist-js', ['concat', 'uglify']);
@@ -285,20 +307,21 @@ module.exports = function(grunt) {
285307
grunt.registerTask('dist', ['clean', 'dist-fonts', 'dist-css', 'dist-js', 'compress:dist']);
286308

287309
// Default task.
288-
grunt.registerTask('default', ['test', 'dist']);
310+
grunt.registerTask('default', ['test-no-html', 'dist']);
289311

290-
// Default task that runs jekyll server, delivers uncompressed css and watch capabilities
312+
// Dev 'default' task that runs jekyll server, delivers uncompressed css and watch capabilities
291313
grunt.registerTask('dev',
292314
[
293-
'lr',
294-
'connect:docs',
295-
'dist-fonts',
296-
'dist-css',
297-
'test',
298-
'dist-js',
299-
'compress:dist',
315+
'lr',
316+
'connect:docs',
317+
'default',
300318
'watch'
301319
]
302320
);
303321

304-
};
322+
// Version numbering task.
323+
// grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
324+
// This can be overzealous, so its changes should always be manually reviewed!
325+
grunt.registerTask('change-version-number', ['sed']);
326+
327+
};

package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
, "keywords": ["bootstrap", "css", "sass", "scss"]
66
, "homepage": "http://alademann.github.io/sass-bootstrap/"
77
, "author": "Aaron Lademann and Twitter Inc."
8-
, "scripts": { "dist": "grunt dist" }
8+
, "scripts": { "test": "grunt test" }
99
, "repository": {
1010
"type": "git"
1111
, "url": "https://github.com/alademann/sass-bootstrap.git"
@@ -18,21 +18,23 @@
1818
]
1919
, "devDependencies": {
2020
"grunt": "~0.4.1"
21-
, "qunitjs": "~1.12.0"
22-
, "grunt-contrib-qunit": "~0.2.2"
23-
, "grunt-lib-phantomjs": "~0.3.1"
24-
, "grunt-contrib-jshint": "~0.6.0"
2521
, "grunt-contrib-clean": "~0.5.0"
26-
, "grunt-contrib-connect": "~0.3.0"
2722
, "grunt-contrib-concat": "~0.3.0"
28-
, "grunt-contrib-copy": "~0.4.0"
29-
, "grunt-contrib-uglify": "~0.2.2"
30-
, "grunt-contrib-watch": "~0.5.1"
31-
, "grunt-contrib-compress": "0.5.2"
23+
, "grunt-contrib-connect": "~0.3.0"
24+
, "grunt-contrib-copy": "~0.4.1"
25+
, "grunt-contrib-jshint": "~0.7.0"
26+
, "grunt-lib-phantomjs": "~0.3.1"
27+
, "qunitjs": "~1.12.0"
28+
, "grunt-contrib-qunit": "~0.3.0"
29+
, "grunt-contrib-uglify": "~0.2.4"
30+
, "grunt-contrib-watch": "~0.5.3"
31+
, "grunt-html-validation": "~0.1.6"
32+
, "grunt-jekyll": "~0.4.0"
3233
, "grunt-contrib-compass": "~0.2.0"
34+
, "grunt-contrib-compress": "0.5.2"
3335
, "grunt-contrib-cssmin": "~0.6.1"
34-
, "grunt-html-validation": "~0.1.4"
3536
, "grunt-css": "~0.5.4"
36-
, "grunt-jekyll": "~0.3.8"
37+
, "grunt-sed": "~0.1.1"
38+
, "regexp-quote": "~0.0.0"
3739
}
3840
}

0 commit comments

Comments
 (0)