mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Merge pull request #6450 from atom/as-better-travis-ci
Make Travis build more resilient
This commit is contained in:
14
.travis.yml
14
.travis.yml
@@ -2,21 +2,19 @@ git:
|
||||
depth: 10
|
||||
|
||||
env:
|
||||
- NODE_VERSION=0.10
|
||||
- NODE_VERSION=0.12
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
sudo: false
|
||||
|
||||
install:
|
||||
- git clone https://github.com/creationix/nvm.git /tmp/.nvm
|
||||
- source /tmp/.nvm/nvm.sh
|
||||
- nvm install $NODE_VERSION
|
||||
- nvm use $NODE_VERSION
|
||||
- if [ $TRAVIS_OS_NAME == "linux" ]; then
|
||||
sudo apt-get install build-essential git libgnome-keyring-dev fakeroot;
|
||||
fi
|
||||
|
||||
script: script/cibuild
|
||||
|
||||
@@ -24,3 +22,11 @@ notifications:
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: change
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- build-essential
|
||||
- git
|
||||
- libgnome-keyring-dev
|
||||
- fakeroot
|
||||
|
||||
@@ -4,7 +4,13 @@ path = require 'path'
|
||||
_ = require 'underscore-plus'
|
||||
async = require 'async'
|
||||
|
||||
concurrency = 2
|
||||
# TODO: This should really be parallel on every platform, however:
|
||||
# - On Windows, our fixtures step on each others toes.
|
||||
# - On Travis, Mac workers haven't enough horsepower.
|
||||
if process.env.TRAVIS or process.platform is 'win32'
|
||||
concurrency = 1
|
||||
else
|
||||
concurrency = 2
|
||||
|
||||
module.exports = (grunt) ->
|
||||
{isAtomPackage, spawn} = require('./task-helpers')(grunt)
|
||||
@@ -78,7 +84,7 @@ module.exports = (grunt) ->
|
||||
continue unless isAtomPackage(packagePath)
|
||||
packageSpecQueue.push(packagePath)
|
||||
|
||||
packageSpecQueue.concurrency = concurrency - 1
|
||||
packageSpecQueue.concurrency = Math.max(1, concurrency - 1)
|
||||
packageSpecQueue.drain = -> callback(null, failedPackages)
|
||||
|
||||
runCoreSpecs = (callback) ->
|
||||
@@ -119,13 +125,11 @@ module.exports = (grunt) ->
|
||||
grunt.registerTask 'run-specs', 'Run the specs', ->
|
||||
done = @async()
|
||||
startTime = Date.now()
|
||||
|
||||
# TODO: This should really be parallel on both platforms, however our
|
||||
# fixtures step on each others toes currently.
|
||||
if process.platform in ['darwin', 'linux']
|
||||
method = async.parallel
|
||||
else if process.platform is 'win32'
|
||||
method = async.series
|
||||
method =
|
||||
if concurrency is 1
|
||||
async.series
|
||||
else
|
||||
async.parallel
|
||||
|
||||
method [runCoreSpecs, runPackageSpecs], (error, results) ->
|
||||
[coreSpecFailed, failedPackages] = results
|
||||
|
||||
Reference in New Issue
Block a user