Hello everyone,
I just read the documentation of dynamic configuration and I tried it with this config :
config.yaml
version: 2.1
# this allows you to use CircleCI's dynamic configuration feature
setup: true
# the path-filtering orb is required to continue a pipeline based on
# the path of an updated fileset
orbs:
path-filtering: circleci/path-filtering@0.1.1
parameters:
run-build-client-job:
type: boolean
default: false
run-build-server-job:
type: boolean
default: false
jobs:
check_commit_message:
docker:
- image: alpine/git:2.36.3
steps:
- checkout
- run:
name: Check commit message for [skip circleci]
command: |
if git log -1 --pretty=%B | grep -q -F '[skip circleci]'; then
echo "CircleCI will NOT run the jobs"
exit 1
else
echo "CircleCI will run the jobs"
circleci-agent step halt
fi
workflows:
# the always-run workflow is always triggered, regardless of the pipeline parameters.
always-run:
jobs:
- check_commit_message
# the path-filtering/filter job determines which pipeline
# parameters to update.
- path-filtering/filter:
name: check-updated-files
# 3-column, whitespace-delimited mapping. One mapping per
# line:
# <regex path-to-test> <parameter-to-set> <value-of-pipeline-parameter>
mapping: |
client/.* run-build-client-job true
server/.* run-build-server-job true
base-revision: main
# this is the path of the configuration we should trigger once
# path filtering and pipeline parameter value updates are
# complete. In this case, we are using the parent dynamic
# configuration itself.
config-path: .circleci/continue_config.yml
continue_config.yml
version: 2.1
orbs:
codecov: codecov/codecov@3.2.4
parameters:
run-build-client-job:
type: boolean
default: false
run-build-server-job:
type: boolean
default: false
jobs:
code-quality-server:
docker:
- image: cimg/php:8.2.12-browsers
resource_class: large
steps:
- when:
condition: << pipeline.parameters.run-build-server-job >>
steps:
- checkout
- run: sudo echo 'memory_limit = 256M' | sudo tee -a /usr/local/etc/php/conf.d/docker-php-memlimit.ini
- run: *server-dependencies
- restore_cache: *restore_cache-server-deps-php
- restore_cache: *restore_cache-server-deps-node
- restore_cache:
key: server-build-<< pipeline.id >>
- run: make -C server lint.js
- run: make -C server lint.php-cs-fixer@integration
- run: make -C server lint.phpstan@integration
etc
With this I have the error
ERROR IN CONFIG FILE:
[#/jobs/code-quality-server] only 1 subschema matches out of 2
1. [#/jobs/code-quality-server/steps] expected minimum item count: 1, found: 0
| SCHEMA:
| minItems: 1
| INPUT:
| null
And It comes from condition: << pipeline.parameters.run-build-server-job >> when i don’t make changes in the server folder and i don’t know why. It should just have pass the job
Thank you per advance for your help