This repository demonstrates an advanced use case of dynamic config feature on CircleCI. For instance, it implements both path filtering and config splitting.
.circleci/config.ymlimplements both 1) the dynamic config, and 2) common resources (i.e., jobs and commands) for main workflows/jobs. These common resources are shared among every module.module-a/.circleci/config.yml,module-b/.circleci/config.yml, andmodule-c/.circleci/config.ymlimplement independent modular configs for module A, B, and C, respectively.
- Upon the initial trigger, CircleCI triggers the setup job
setup-dynamic-configdefined in.circleci/config.yml. - Given a list of directories, detect which subdirectories (in this case, modules modules) have changes. (cf.
list-changed-modules) - Fetch
path-to-module/.circleci/config.ymlfor each module to build, and merge all the fetchedconfig.yml(along with the config defining common resources, i.e.,.circleci/config.yml) usingyq. (cf.merge-modular-configs) - Trigger execution of the merged config.