forked from espressif/esp-idf
ci: add name for child pipelines
This commit is contained in:
@@ -17,6 +17,9 @@ DEFAULT_CASES_TEST_PER_JOB = 30
|
|||||||
DEFAULT_BUILD_CHILD_PIPELINE_FILEPATH = os.path.join(IDF_PATH, 'build_child_pipeline.yml')
|
DEFAULT_BUILD_CHILD_PIPELINE_FILEPATH = os.path.join(IDF_PATH, 'build_child_pipeline.yml')
|
||||||
DEFAULT_TARGET_TEST_CHILD_PIPELINE_FILEPATH = os.path.join(IDF_PATH, 'target_test_child_pipeline.yml')
|
DEFAULT_TARGET_TEST_CHILD_PIPELINE_FILEPATH = os.path.join(IDF_PATH, 'target_test_child_pipeline.yml')
|
||||||
|
|
||||||
|
DEFAULT_BUILD_CHILD_PIPELINE_NAME = 'Build Child Pipeline'
|
||||||
|
DEFAULT_TARGET_TEST_CHILD_PIPELINE_NAME = 'Target Test Child Pipeline'
|
||||||
|
|
||||||
TEST_RELATED_BUILD_JOB_NAME = 'build_test_related_apps'
|
TEST_RELATED_BUILD_JOB_NAME = 'build_test_related_apps'
|
||||||
NON_TEST_RELATED_BUILD_JOB_NAME = 'build_non_test_related_apps'
|
NON_TEST_RELATED_BUILD_JOB_NAME = 'build_non_test_related_apps'
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@ import __init__ # noqa: F401 # inject the system path
|
|||||||
import yaml
|
import yaml
|
||||||
from dynamic_pipelines.constants import DEFAULT_APPS_BUILD_PER_JOB
|
from dynamic_pipelines.constants import DEFAULT_APPS_BUILD_PER_JOB
|
||||||
from dynamic_pipelines.constants import DEFAULT_BUILD_CHILD_PIPELINE_FILEPATH
|
from dynamic_pipelines.constants import DEFAULT_BUILD_CHILD_PIPELINE_FILEPATH
|
||||||
|
from dynamic_pipelines.constants import DEFAULT_BUILD_CHILD_PIPELINE_NAME
|
||||||
from dynamic_pipelines.constants import DEFAULT_TEST_PATHS
|
from dynamic_pipelines.constants import DEFAULT_TEST_PATHS
|
||||||
from dynamic_pipelines.constants import NON_TEST_RELATED_APPS_FILENAME
|
from dynamic_pipelines.constants import NON_TEST_RELATED_APPS_FILENAME
|
||||||
from dynamic_pipelines.constants import NON_TEST_RELATED_BUILD_JOB_NAME
|
from dynamic_pipelines.constants import NON_TEST_RELATED_BUILD_JOB_NAME
|
||||||
@@ -133,7 +134,7 @@ def main(arguments: argparse.Namespace) -> None:
|
|||||||
else:
|
else:
|
||||||
extra_include_yml = ['tools/ci/dynamic_pipelines/templates/test_child_pipeline.yml']
|
extra_include_yml = ['tools/ci/dynamic_pipelines/templates/test_child_pipeline.yml']
|
||||||
|
|
||||||
dump_jobs_to_yaml(build_jobs, arguments.yaml_output, extra_include_yml)
|
dump_jobs_to_yaml(build_jobs, arguments.yaml_output, DEFAULT_BUILD_CHILD_PIPELINE_NAME, extra_include_yml)
|
||||||
print(f'Generate child pipeline yaml file {arguments.yaml_output} with {sum(j.parallel for j in build_jobs)} jobs')
|
print(f'Generate child pipeline yaml file {arguments.yaml_output} with {sum(j.parallel for j in build_jobs)} jobs')
|
||||||
|
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@ import yaml
|
|||||||
from dynamic_pipelines.constants import BUILD_ONLY_LABEL
|
from dynamic_pipelines.constants import BUILD_ONLY_LABEL
|
||||||
from dynamic_pipelines.constants import DEFAULT_CASES_TEST_PER_JOB
|
from dynamic_pipelines.constants import DEFAULT_CASES_TEST_PER_JOB
|
||||||
from dynamic_pipelines.constants import DEFAULT_TARGET_TEST_CHILD_PIPELINE_FILEPATH
|
from dynamic_pipelines.constants import DEFAULT_TARGET_TEST_CHILD_PIPELINE_FILEPATH
|
||||||
|
from dynamic_pipelines.constants import DEFAULT_TARGET_TEST_CHILD_PIPELINE_NAME
|
||||||
from dynamic_pipelines.constants import DEFAULT_TEST_PATHS
|
from dynamic_pipelines.constants import DEFAULT_TEST_PATHS
|
||||||
from dynamic_pipelines.constants import KNOWN_GENERATE_TEST_CHILD_PIPELINE_WARNINGS_FILEPATH
|
from dynamic_pipelines.constants import KNOWN_GENERATE_TEST_CHILD_PIPELINE_WARNINGS_FILEPATH
|
||||||
from dynamic_pipelines.models import EmptyJob
|
from dynamic_pipelines.models import EmptyJob
|
||||||
@@ -170,7 +171,7 @@ def generate_target_test_child_pipeline(
|
|||||||
if no_env_marker_test_cases_fail or no_runner_tags_fail:
|
if no_env_marker_test_cases_fail or no_runner_tags_fail:
|
||||||
raise SystemExit('Failed to generate target test child pipeline.')
|
raise SystemExit('Failed to generate target test child pipeline.')
|
||||||
|
|
||||||
dump_jobs_to_yaml(target_test_jobs, output_filepath, extra_include_yml)
|
dump_jobs_to_yaml(target_test_jobs, output_filepath, DEFAULT_TARGET_TEST_CHILD_PIPELINE_NAME, extra_include_yml)
|
||||||
print(f'Generate child pipeline yaml file {output_filepath} with {sum(j.parallel for j in target_test_jobs)} jobs')
|
print(f'Generate child pipeline yaml file {output_filepath} with {sum(j.parallel for j in target_test_jobs)} jobs')
|
||||||
|
|
||||||
|
|
||||||
|
@@ -21,7 +21,10 @@ from .models import TestCase
|
|||||||
|
|
||||||
|
|
||||||
def dump_jobs_to_yaml(
|
def dump_jobs_to_yaml(
|
||||||
jobs: t.List[Job], output_filepath: str, extra_include_yml: t.Optional[t.List[str]] = None
|
jobs: t.List[Job],
|
||||||
|
output_filepath: str,
|
||||||
|
pipeline_name: str,
|
||||||
|
extra_include_yml: t.Optional[t.List[str]] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
yaml_dict = {}
|
yaml_dict = {}
|
||||||
for job in jobs:
|
for job in jobs:
|
||||||
@@ -35,6 +38,7 @@ def dump_jobs_to_yaml(
|
|||||||
'.gitlab/ci/common.yml',
|
'.gitlab/ci/common.yml',
|
||||||
],
|
],
|
||||||
'workflow': {
|
'workflow': {
|
||||||
|
'name': pipeline_name,
|
||||||
'rules': [
|
'rules': [
|
||||||
# always run the child pipeline, if they are created
|
# always run the child pipeline, if they are created
|
||||||
{'when': 'always'},
|
{'when': 'always'},
|
||||||
|
Reference in New Issue
Block a user