mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
Parallelize Flow in CI (#20794)
* Parallelize Flow in CI We added more host configs recently, and we run all the checks in sequence, so sometimes Flow ends up being the slowest CI job. This splits the job across multiple processes. * Fix environment variable typo Co-authored-by: Ricky <rickhanlonii@gmail.com> Co-authored-by: Ricky <rickhanlonii@gmail.com>
This commit is contained in:
parent
eee874ce6e
commit
9e9be6c6b3
|
|
@ -83,6 +83,7 @@ jobs:
|
|||
yarn_flow:
|
||||
docker: *docker
|
||||
environment: *environment
|
||||
parallelism: 5
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
|
|
@ -384,9 +385,6 @@ workflows:
|
|||
- yarn_lint:
|
||||
requires:
|
||||
- setup
|
||||
- yarn_flow:
|
||||
requires:
|
||||
- setup
|
||||
- RELEASE_CHANNEL_stable_yarn_build:
|
||||
requires:
|
||||
- setup
|
||||
|
|
@ -426,6 +424,9 @@ workflows:
|
|||
unless: << pipeline.parameters.prerelease_commit_sha >>
|
||||
jobs:
|
||||
- setup
|
||||
- yarn_flow:
|
||||
requires:
|
||||
- setup
|
||||
- yarn_test:
|
||||
requires:
|
||||
- setup
|
||||
|
|
|
|||
|
|
@ -14,12 +14,22 @@ process.on('unhandledRejection', err => {
|
|||
const runFlow = require('../flow/runFlow');
|
||||
const inlinedHostConfigs = require('../shared/inlinedHostConfigs');
|
||||
|
||||
// Parallelize tests across multiple tasks.
|
||||
const nodeTotal = process.env.CIRCLE_NODE_TOTAL
|
||||
? parseInt(process.env.CIRCLE_NODE_TOTAL, 10)
|
||||
: 1;
|
||||
const nodeIndex = process.env.CIRCLE_NODE_INDEX
|
||||
? parseInt(process.env.CIRCLE_NODE_INDEX, 10)
|
||||
: 0;
|
||||
|
||||
async function checkAll() {
|
||||
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
|
||||
for (let rendererInfo of inlinedHostConfigs) {
|
||||
if (rendererInfo.isFlowTyped) {
|
||||
await runFlow(rendererInfo.shortName, ['check']);
|
||||
console.log();
|
||||
for (let i = 0; i < inlinedHostConfigs.length; i++) {
|
||||
if (i % nodeTotal === nodeIndex) {
|
||||
const rendererInfo = inlinedHostConfigs[i];
|
||||
if (rendererInfo.isFlowTyped) {
|
||||
await runFlow(rendererInfo.shortName, ['check']);
|
||||
console.log();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user