ci: continue on fail
This commit is contained in:
parent
68b007a078
commit
7af9d9083a
|
@ -7,25 +7,19 @@ const {
|
||||||
FLECKS_CORE_ROOT = process.cwd(),
|
FLECKS_CORE_ROOT = process.cwd(),
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
|
const args = ['npm', 'run', ...process.argv.slice(2)];
|
||||||
const {workspaces} = require(join(FLECKS_CORE_ROOT, 'package.json'));
|
const {workspaces} = require(join(FLECKS_CORE_ROOT, 'package.json'));
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const paths = (
|
const paths = (await Promise.all(workspaces.map((path) => glob(join(FLECKS_CORE_ROOT, path)))))
|
||||||
await Promise.all(workspaces.map((workspace) => glob(join(FLECKS_CORE_ROOT, workspace))))
|
|
||||||
)
|
|
||||||
.flat();
|
.flat();
|
||||||
const cpus = new Array(require('os').cpus().length).fill(Promise.resolve(0));
|
const cpus = new Array(require('os').cpus().length).fill(Promise.resolve(0));
|
||||||
for (let i = 0; i < paths.length; ++i) {
|
for (let i = 0; i < paths.length; ++i) {
|
||||||
|
// then= :)
|
||||||
cpus[i % cpus.length] = cpus[i % cpus.length]
|
cpus[i % cpus.length] = cpus[i % cpus.length]
|
||||||
.then(
|
.then(((cwd) => async (code) => (
|
||||||
((cwd) => (
|
(await processCode(spawnWith(args, {cwd}))) || code
|
||||||
(code) => {
|
))(paths[i]));
|
||||||
return 0 === code
|
|
||||||
? processCode(spawnWith(['npm', 'run', ...process.argv.slice(2)], {cwd}))
|
|
||||||
: code;
|
|
||||||
}
|
|
||||||
))(paths[i]),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
process.exitCode = (await Promise.all(cpus)).find((code) => code !== 0) || 0;
|
process.exitCode = (await Promise.all(cpus)).find((code) => code !== 0) || 0;
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user