rules:changes , fall through to match multiple rules (AND-style)
The documentation for rules says: rules allows for a list of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job.
Is there a way to 'fall through' and require all rules to match?
For example, If there is a change to the unit test files I want to create a job that only runs the unit testing (and downloads prebuilt binaries from the last release). This saves a lots of time rebuilding the software.
That requires that the changeset only contains changes to unit test files, and not to any code. If code is modified, I want the build+test(with newly build binaries) to trigger.
For example, I'd like to roughly do this:
test_files_changed_only:
stage: test
script:
- echo "Hi there!"
rules:
# If a file under test/ changed, make the job eligible to run.
- changes:
- "test/**/*"
when: always
fall_through: true
# BUT if there are changes to non-test code, then don't run this job!
- changes:
- ! "test/**/*"
when: never I don't think this is currently possible with rules:changes or only/except:changes. (and am I correct that there is no support for RE2-style pattern matching for changes?)
Having a fall_through mechanism to AND multiple rules would help I think.
The only other possibility I see is to launch a job that looks at the changeset and then launches a new pipeline depending on what changed.
Thank you for your feedback.