/circleci-parallel-based-on-env

Runs CircleCI job in parallel depending on environment variable

circleci-parallel-based-on-env CircleCI

CircleCI cannot vary parallelism parameter based on environment variable. But you can define different jobs (or even a single job with a parameter), and pick one to run based on branches, see config docs

To see effective config

circleci config process circle.yml | sed /^#/d

So we do the following: in the workflow we call same job depending on the branch filters, and we pass a parameter to the job to control parallelism.

  • if this is a master or internal branch and internal pull request, the branch name will be whatever you set it to.
  • if pull request is coming from external forked branch, then the branch will be named pull/<number>

See circle.yml and compare the runs