Skip to content

Latest commit

 

History

History
31 lines (18 loc) · 1.7 KB

README.md

File metadata and controls

31 lines (18 loc) · 1.7 KB

Dynamic Configuration on CircleCI

Here's a detailed post on how to set up a repo like this.

Forked from circle-makotom/circle-advanced-setup-workflow.

Makoto Mizukami gets all of the credit for the CircleCI® configs, and the entire concept of this repo.

As a slight change, the module directories are organized by language, like js/ and php/.

This is similar to how WordPress plugins can look.

Only runs jobs that are needed

The great thing about Makoto's idea here is that jobs only run when there's a certain diff.

For example, if there's no .php file in the diff, the PHPUnit tests won't run.

If there's no .js file in the diff, the Jest tests won't run.

And if the PR only changes README.md, no dynamic job will run, only the job Create dynamic jobs.

This repository demonstrates an advanced use case of the setup workflow feature on CircleCI.

How does it work?

  1. CircleCI triggers the setup job Create dynamic jobs, defined in .circleci/config.yml.
  2. That job finds which file types were changed in the current branch versus the main branch.
  3. It emits those changed file types as pipeline parameters.
  4. .circleci/workflow.yml receives those pipeline parameters, like << pipeline.parameters.run-php >>.
  5. Those determine whether to run the jobs for php/, js/, and e2e/.