ClickHouse/ci_v2/workflows/pull_request.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
961 B
Python
Raw Normal View History

2024-09-28 05:46:19 +00:00
from typing import List
2024-09-30 11:43:03 +00:00
from ci_v2.settings.definitions import (
2024-09-28 05:46:19 +00:00
BASE_BRANCH,
DOCKERS,
SECRETS,
JobNames,
RunnerLabels,
)
2024-09-30 11:43:03 +00:00
from praktika import Job, Workflow
2024-09-28 05:46:19 +00:00
2024-09-30 11:43:03 +00:00
style_check_job = Job.Config(
2024-09-28 05:46:19 +00:00
name=JobNames.STYLE_CHECK,
runs_on=[RunnerLabels.CI_SERVICES],
2024-09-30 11:43:03 +00:00
command="python3 ./ci_v2/jobs/check_style.py",
2024-09-28 05:46:19 +00:00
run_in_docker="clickhouse/style-test",
)
workflow = Workflow.Config(
name="PR",
event=Workflow.Event.PULL_REQUEST,
base_branches=[BASE_BRANCH],
jobs=[
2024-09-30 11:43:03 +00:00
style_check_job,
2024-09-28 05:46:19 +00:00
],
dockers=DOCKERS,
secrets=SECRETS,
enable_cache=True,
enable_report=True,
enable_merge_ready_status=True,
)
WORKFLOWS = [
workflow,
] # type: List[Workflow.Config]
if __name__ == "__main__":
# example: local job test inside praktika environment
from praktika.runner import Runner
2024-09-30 11:43:03 +00:00
Runner.generate_dummy_environment(workflow, style_check_job)
2024-09-28 05:46:19 +00:00
2024-09-30 11:43:03 +00:00
Runner().run(workflow, style_check_job)