Often I repetition inside the jobs-steps-List. By leveraging YAML alias and references one could have a macro like functionality in config.yml:
stepslist: &stepslist - checkout: path: ~/repo - run: doit -f dodo-new.py submodules - restore_cache: … - run: doit -f dodo-new.py BUILD - save_cache: …jobs: build:… steps: - *stepslist - run: doit -f dodo-new.py CICHECK CITEST
Using YAML
<<:
merge as suggested in https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/ does not work with steps because steps is a list. Do the config shown above dos not work currently.But if Circle CI would accept a list of lists (basically run
steps.flatten()
) it would enable using this functionality reducing config duplication without much added complexity. https://discuss.circleci.com/t/yaml-anchors-implementation-incomplete/16916 is the same problem.
CCI-I-424