diff options
| author | Vojta Jina | 2013-07-01 16:21:56 -0700 |
|---|---|---|
| committer | Vojta Jina | 2013-07-02 15:12:03 -0700 |
| commit | 52519d45b94d43c6dcd60d0845b1914edf5c743c (patch) | |
| tree | 38a8cc922407f2e51660867c4ad9d3d2ed10b489 /Gruntfile.js | |
| parent | 78728df09907e7f63a50fe5ecbb2673a74556a5b (diff) | |
| download | angular.js-52519d45b94d43c6dcd60d0845b1914edf5c743c.tar.bz2 | |
chore(travis): speed up the build
- parallelize the tasks
- cache requests (e2e tests)
This reduces the time from ~18min to ~12min.
It makes the output little messy. We could buffer output of each task and display it once it's fully finished, nicely. I think giving instant feedback is better.
Diffstat (limited to 'Gruntfile.js')
| -rw-r--r-- | Gruntfile.js | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 2cbfcda3..9a470d3d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,6 +7,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-compress'); + grunt.loadNpmTasks('grunt-parallel'); grunt.loadTasks('lib/grunt'); var NG_VERSION = util.getVersion(); @@ -21,6 +22,20 @@ module.exports = function(grunt) { grunt.initConfig({ NG_VERSION: NG_VERSION, + parallel: { + travis: { + options: { + stream: true, + }, + tasks: [ + util.parallelTask('test:modules'), + util.parallelTask('test:jquery'), + util.parallelTask('test:jqlite'), + util.parallelTask('test:e2e') + ] + } + }, + connect: { devserver: { options: { @@ -40,7 +55,24 @@ module.exports = function(grunt) { } } }, - testserver: {} + testserver: { + options: { + middleware: function(connect, options){ + return [ + function(req, resp, next) { + // cache get requests to speed up tests on travis + if (req.method === 'GET') { + resp.setHeader('Cache-control', 'public, max-age=3600'); + } + + next(); + }, + connect.favicon('images/favicon.ico'), + connect.static(options.base) + ]; + } + } + } }, |
