Skip to content

Commit

Permalink
Merge pull request #26678 from storybookjs/valentin/fix-ci-3
Browse files Browse the repository at this point in the history
CI: Fix parallelism for check and compile command on CI
(cherry picked from commit 663194c)
  • Loading branch information
valentinpalkovic authored and yannbf committed Apr 19, 2024
1 parent 9eaf01a commit bb52476
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion scripts/tasks/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import type { Task } from '../task';
import { exec } from '../utils/exec';
import { maxConcurrentTasks } from '../utils/maxConcurrentTasks';

const parallel = process.env.CI ? 8 : maxConcurrentTasks;
// The amount of VCPUs for the check task on CI is 8 (xlarge resource)
const amountOfVCPUs = 8;

const parallel = `--parallel=${process.env.CI ? amountOfVCPUs - 1 : maxConcurrentTasks}`;

const linkCommand = `nx run-many --target="check" --all --parallel=${parallel} --exclude=@storybook/vue,@storybook/svelte,@storybook/vue3,@storybook/angular`;
const nolinkCommand = `nx run-many --target="check" --all --parallel=${parallel}`;
Expand Down
9 changes: 7 additions & 2 deletions scripts/tasks/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ import { maxConcurrentTasks } from '../utils/maxConcurrentTasks';
import { exec } from '../utils/exec';
import type { Task } from '../task';

// The amount of VCPUs for the check task on CI is 4 (large resource)
const amountOfVCPUs = 4;

const parallel = `--parallel=${process.env.CI ? amountOfVCPUs - 1 : maxConcurrentTasks}`;

const linkedContents = `export * from '../src/index';`;
const linkCommand = `nx run-many --target="prep" --all --parallel --max-parallel=${maxConcurrentTasks} -- --reset`;
const linkCommand = `nx run-many --target="prep" --all --parallel --max-parallel=${parallel} -- --reset`;
const noLinkCommand = `nx run-many --target="prep" --all --parallel=8 ${
process.env.CI ? `--max-parallel=${maxConcurrentTasks}` : ''
process.env.CI ? `--max-parallel=${parallel}` : ''
} -- --reset --optimized`;

export const compile: Task = {
Expand Down

0 comments on commit bb52476

Please sign in to comment.