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