Skip to content

An example of a CircleCI® dynamic config, forked from circle-makotom/circle-advanced-setup-workflow

License

Notifications You must be signed in to change notification settings

getlocalci/circle-advanced-setup-workflow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/.

About

An example of a CircleCI® dynamic config, forked from circle-makotom/circle-advanced-setup-workflow

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 76.1%
  • PHP 23.9%