CI: Trigger pr-test-* pipelines on different cases (#48426)
* Trigger pr-test-backend pipeline on pkg/* changes * Exclude paths for pr-test-frontend pipeline * Add more paths * Revert *.md - trigger on go.* changes * Replace star with doublestar
This commit is contained in:
committed by
GitHub
parent
e452785291
commit
b6a329c268
@@ -84,7 +84,7 @@ def pr_test_frontend():
|
||||
test_frontend_step(),
|
||||
]
|
||||
return pipeline(
|
||||
name='pr-test-frontend', edition="oss", trigger=trigger, services=[], steps=init_steps + test_steps,
|
||||
name='pr-test-frontend', edition="oss", trigger=get_pr_trigger(exclude_paths=['pkg/**', 'packaging/**', 'go.sum', 'go.mod']), services=[], steps=init_steps + test_steps,
|
||||
)
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ def pr_test_backend():
|
||||
test_backend_integration_step(edition="oss"),
|
||||
]
|
||||
return pipeline(
|
||||
name='pr-test-backend', edition="oss", trigger=trigger, services=[], steps=init_steps + test_steps,
|
||||
name='pr-test-backend', edition="oss", trigger=get_pr_trigger(include_paths=['pkg/**', 'packaging/**', '.drone.yml', 'conf/**', 'go.sum', 'go.mod']), services=[], steps=init_steps + test_steps,
|
||||
)
|
||||
|
||||
|
||||
@@ -160,3 +160,24 @@ def pr_pipelines(edition):
|
||||
volumes=volumes,
|
||||
), docs_pipelines(edition, ver_mode, trigger_docs())
|
||||
]
|
||||
|
||||
|
||||
def get_pr_trigger(include_paths=None, exclude_paths=None):
|
||||
paths_ex = ['docs/**', '*.md']
|
||||
paths_in = []
|
||||
if include_paths:
|
||||
for path in include_paths:
|
||||
paths_in.extend([path])
|
||||
if exclude_paths:
|
||||
for path in exclude_paths:
|
||||
paths_ex.extend([path])
|
||||
return {
|
||||
'event': [
|
||||
'pull_request',
|
||||
],
|
||||
'paths': {
|
||||
'exclude': paths_ex,
|
||||
'include': paths_in,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user