diff options
| author | Vojta Jina | 2013-07-01 16:21:56 -0700 | 
|---|---|---|
| committer | Vojta Jina | 2013-07-02 13:58:52 -0700 | 
| commit | 2c2adbcab54d3504f1ae9c91b761c2a18a5d8468 (patch) | |
| tree | be6495fd2177a8e458a68ead12bfda173baae51a /Gruntfile.js | |
| parent | 6e1b64176f91ef6049cd03dc666554b7e04a9000 (diff) | |
| download | angular.js-2c2adbcab54d3504f1ae9c91b761c2a18a5d8468.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 | 35 | 
1 files changed, 34 insertions, 1 deletions
| diff --git a/Gruntfile.js b/Gruntfile.js index 968b2b82..e420498a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,6 +9,7 @@ module.exports = function(grunt) {    grunt.loadNpmTasks('grunt-contrib-compress');    grunt.loadNpmTasks('grunt-contrib-jasmine-node');    grunt.loadNpmTasks('grunt-shell'); +  grunt.loadNpmTasks('grunt-parallel');    grunt.loadTasks('lib/grunt');    var NG_VERSION = util.getVersion(); @@ -23,6 +24,21 @@ module.exports = function(grunt) {    grunt.initConfig({      NG_VERSION: NG_VERSION, +    parallel: { +      travis: { +        options: { +          stream: true, +        }, +        tasks: [ +          util.parallelTask('test:docs'), +          util.parallelTask('test:modules'), +          util.parallelTask('test:jquery'), +          util.parallelTask('test:jqlite'), +          util.parallelTask('test:e2e') +        ] +      } +    }, +      connect: {        devserver: {          options: { @@ -42,7 +58,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) +            ]; +          } +        } +      }      }, | 
