mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
minor fix for wf status reporting
This commit is contained in:
parent
b164014bf9
commit
bb28a65e98
3
.github/workflows/backport_branches.yml
vendored
3
.github/workflows/backport_branches.yml
vendored
@ -272,7 +272,4 @@ jobs:
|
||||
cat >> "$WORKFLOW_RESULT_FILE" << 'EOF'
|
||||
${{ toJson(needs) }}
|
||||
EOF
|
||||
echo "::group::Workflow results"
|
||||
python3 -m json.tool "$WORKFLOW_RESULT_FILE"
|
||||
echo "::endgroup::"
|
||||
python3 ./tests/ci/ci_buddy.py --check-wf-status
|
||||
|
3
.github/workflows/master.yml
vendored
3
.github/workflows/master.yml
vendored
@ -138,7 +138,4 @@ jobs:
|
||||
cat >> "$WORKFLOW_RESULT_FILE" << 'EOF'
|
||||
${{ toJson(needs) }}
|
||||
EOF
|
||||
echo "::group::Workflow results"
|
||||
python3 -m json.tool "$WORKFLOW_RESULT_FILE"
|
||||
echo "::endgroup::"
|
||||
python3 ./tests/ci/ci_buddy.py --check-wf-status
|
||||
|
3
.github/workflows/merge_queue.yml
vendored
3
.github/workflows/merge_queue.yml
vendored
@ -111,7 +111,4 @@ jobs:
|
||||
cat >> "$WORKFLOW_RESULT_FILE" << 'EOF'
|
||||
${{ toJson(needs) }}
|
||||
EOF
|
||||
echo "::group::Workflow results"
|
||||
python3 -m json.tool "$WORKFLOW_RESULT_FILE"
|
||||
echo "::endgroup::"
|
||||
python3 ./tests/ci/ci_buddy.py --check-wf-status
|
||||
|
3
.github/workflows/nightly.yml
vendored
3
.github/workflows/nightly.yml
vendored
@ -57,7 +57,4 @@ jobs:
|
||||
cat >> "$WORKFLOW_RESULT_FILE" << 'EOF'
|
||||
${{ toJson(needs) }}
|
||||
EOF
|
||||
echo "::group::Workflow results"
|
||||
python3 -m json.tool "$WORKFLOW_RESULT_FILE"
|
||||
echo "::endgroup::"
|
||||
python3 ./tests/ci/ci_buddy.py --check-wf-status
|
||||
|
3
.github/workflows/pull_request.yml
vendored
3
.github/workflows/pull_request.yml
vendored
@ -171,9 +171,6 @@ jobs:
|
||||
cat >> "$WORKFLOW_RESULT_FILE" << 'EOF'
|
||||
${{ toJson(needs) }}
|
||||
EOF
|
||||
echo "::group::Workflow results"
|
||||
python3 -m json.tool "$WORKFLOW_RESULT_FILE"
|
||||
echo "::endgroup::"
|
||||
python3 ./tests/ci/ci_buddy.py --check-wf-status
|
||||
|
||||
################################# Stage Final #################################
|
||||
|
4
.github/workflows/release_branches.yml
vendored
4
.github/workflows/release_branches.yml
vendored
@ -492,7 +492,5 @@ jobs:
|
||||
cat >> "$WORKFLOW_RESULT_FILE" << 'EOF'
|
||||
${{ toJson(needs) }}
|
||||
EOF
|
||||
echo "::group::Workflow results"
|
||||
python3 -m json.tool "$WORKFLOW_RESULT_FILE"
|
||||
echo "::endgroup::"
|
||||
|
||||
python3 ./tests/ci/ci_buddy.py --check-wf-status
|
||||
|
@ -31,6 +31,7 @@ class CIBuddy:
|
||||
self.sha = pr_info.sha[:10]
|
||||
|
||||
def check_workflow(self):
|
||||
GHActions.print_workflow_results()
|
||||
res = GHActions.get_workflow_job_result(GHActions.ActionsNames.RunConfig)
|
||||
if res != GHActions.ActionStatuses.SUCCESS:
|
||||
self.post_job_error("Workflow Configuration Failed", critical=True)
|
||||
|
@ -92,15 +92,30 @@ class GHActions:
|
||||
PENDING = "pending"
|
||||
SUCCESS = "success"
|
||||
|
||||
@staticmethod
|
||||
def get_workflow_job_result(wf_job_name: str) -> Optional[str]:
|
||||
@classmethod
|
||||
def _get_workflow_results(cls):
|
||||
if not Path(Envs.WORKFLOW_RESULT_FILE).exists():
|
||||
print(
|
||||
f"ERROR: Failed to get workflow results from file [{Envs.WORKFLOW_RESULT_FILE}]"
|
||||
)
|
||||
return None
|
||||
return {}
|
||||
with open(Envs.WORKFLOW_RESULT_FILE, "r", encoding="utf-8") as json_file:
|
||||
res = json.load(json_file)
|
||||
try:
|
||||
res = json.load(json_file)
|
||||
except json.JSONDecodeError as e:
|
||||
print(f"ERROR: json decoder exception {e}")
|
||||
return {}
|
||||
return res
|
||||
|
||||
@classmethod
|
||||
def print_workflow_results(cls):
|
||||
res = cls._get_workflow_results()
|
||||
results = [f"{job}: {data['result']}" for job, data in res.items()]
|
||||
cls.print_in_group("Workflow results", results)
|
||||
|
||||
@classmethod
|
||||
def get_workflow_job_result(cls, wf_job_name: str) -> Optional[str]:
|
||||
res = cls._get_workflow_results()
|
||||
if wf_job_name in res:
|
||||
return res[wf_job_name]["result"] # type: ignore
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user