Skip to content

Commit 4338f9e

Browse files
committed
Build Tooling: Define build concurrency explicitly
1 parent 5dd7e90 commit 4338f9e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ branches:
2525
before_install:
2626
- nvm install
2727

28-
env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
28+
env:
29+
- PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
30+
- HARDWARE_CONCURRENCY=2
2931

3032
jobs:
3133
include:

bin/packages/build.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ if ( ! files.length ) {
4444
};
4545
}
4646

47-
const worker = workerFarm( require.resolve( './build-worker' ) );
47+
const options = {};
48+
if ( process.env.HARDWARE_CONCURRENCY ) {
49+
// WorkerFarm is configured to use the number of CPUs available as the
50+
// default value. This can be overwritten for finite control or for use in
51+
// uncooperative continuous integration.
52+
options.maxConcurrentWorkers = Number( process.env.HARDWARE_CONCURRENCY );
53+
}
54+
55+
const worker = workerFarm( options, require.resolve( './build-worker' ) );
4856

4957
let complete = 0;
5058

0 commit comments

Comments
 (0)