Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit 252a28d

Browse files
committed
Build: Add CI testing
Adds a test task which runs on travis also add csslint and cssmin, this also moves all generated css to a dist/css folder and adds a non minified version of the css as well. Closes gh-49
1 parent 32b88cb commit 252a28d

File tree

4 files changed

+54
-14
lines changed

4 files changed

+54
-14
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ node_modules/
99
external/
1010
icons/svg-min/
1111
.sass-cache/
12+
dist/

.travis.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- "0.10"
5+
cache:
6+
directories:
7+
- node_modules
8+
script:
9+
- "grunt"

Gruntfile.js

+42-14
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,41 @@ var config = {
1616
"ie >= 8"
1717
]
1818
},
19-
src: "*.css"
19+
src: "dist/css/*.css"
2020
}
2121
},
22+
csscomb: {
23+
dist: {
24+
files: {
25+
"dist/css/chassis.css": "dist/css/chassis.css"
26+
}
27+
},
28+
scss: {
29+
files: [ {
30+
expand: true,
31+
src: [ "scss/**/*.scss" ]
32+
} ]
33+
}
34+
},
35+
cssmin: {
36+
options: {
37+
report: "gzip",
38+
sourceMap: true
39+
},
40+
target: {
41+
files: {
42+
"dist/css/chassis.min.css": "dist/css/chassis.css"
43+
}
44+
}
45+
},
46+
csslint: {
47+
src: [ "dist/css/*.css" ]
48+
},
2249
jscs: {
23-
all: [ "*.js", "performance/*.js", "performance/frameworks/*.js" ]
50+
all: [ "*.js", "performance/**/*.js" ]
2451
},
2552
jshint: {
26-
files: [ "*.js", "performance/*.js", "performance/frameworks/*.js" ],
53+
files: [ "*.js", "performance/**/*.js" ],
2754
options: {
2855
jshintrc: ".jshintrc"
2956
}
@@ -32,24 +59,24 @@ var config = {
3259
dist: {
3360
options: {
3461
sourceMap: true,
35-
outputStyle: "compressed"
62+
63+
// This actually does nested until libsass updates to support expanded
64+
outputStyle: "expanded"
3665
},
37-
files: [ {
38-
expand: true,
39-
cwd: "scss",
40-
src: [ "*.scss" ],
41-
dest: "",
42-
ext: ".css"
43-
} ]
66+
files: {
67+
"dist/css/chassis.css": "scss/style.scss"
68+
}
4469
}
4570
},
71+
4672
// Minifies SVGs
4773
svgmin: {
4874
options: {
4975
plugins: [
5076
{
5177
removeViewBox: false
52-
}, {
78+
},
79+
{
5380
removeUselessStrokeAndFill: false
5481
}
5582
]
@@ -127,8 +154,9 @@ grunt.util._.extend( config, loadConfig( "./tasks/options/" ) );
127154
grunt.initConfig( config );
128155
grunt.loadTasks( "tasks" );
129156
grunt.loadNpmTasks( "perfjankie" );
130-
grunt.registerTask( "default", [ "jshint", "jscs" ] );
131-
grunt.registerTask( "build", [ "svg", "sass", "autoprefixer" ] );
157+
grunt.registerTask( "default", [ "test" ] );
158+
grunt.registerTask( "test", [ "build", "jshint", "jscs", "csslint" ] );
159+
grunt.registerTask( "build", [ "svg", "sass", "csscomb", "cssmin" ] );
132160
grunt.registerTask( "perf", [
133161
"start-selenium-server",
134162
"connect:perf",

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
"glob": "4.4.2",
5151
"grunt": "0.4.5",
5252
"grunt-autoprefixer": "2.1.0",
53+
"grunt-contrib-cssmin": "0.10.0",
54+
"grunt-contrib-csslint": "0.4.0",
5355
"grunt-contrib-jshint": "0.10.0",
5456
"grunt-contrib-connect": "0.9.0",
5557
"grunt-contrib-watch": "0.6.1",

0 commit comments

Comments
 (0)