From 316b8dbec2807a94dcd87c8d6ba737ad57ed84f5 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 12 Jun 2024 21:05:39 +0200 Subject: [PATCH] wip --- .github/workflows/osrm-backend.yml | 14 +++++++++++++- scripts/ci/post_benchmark_results.py | 23 ++++++++++++----------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index a8bc1b538..33905aa1f 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -727,7 +727,19 @@ jobs: ./pr/scripts/ci/run_benchmarks.sh base pr - name: Post Benchmark Results run: | - python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results + python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results 1 + - name: Run Benchmarks + run: | + ./pr/scripts/ci/run_benchmarks.sh base pr + - name: Post Benchmark Results + run: | + python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results 2 + - name: Run Benchmarks + run: | + ./pr/scripts/ci/run_benchmarks.sh base pr + - name: Post Benchmark Results + run: | + python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results 3 - name: Show CCache statistics run: | ccache -p diff --git a/scripts/ci/post_benchmark_results.py b/scripts/ci/post_benchmark_results.py index 339534a19..c6659cffe 100644 --- a/scripts/ci/post_benchmark_results.py +++ b/scripts/ci/post_benchmark_results.py @@ -69,6 +69,7 @@ def main(): base_folder = sys.argv[1] pr_folder = sys.argv[2] + run_number = sys.argv[3] benchmark_results = collect_benchmark_results(base_folder, pr_folder) @@ -78,23 +79,23 @@ def main(): markdown_table = create_markdown_table(benchmark_results) new_benchmark_section = f""" - +

Benchmark Results

{markdown_table}
- + """ - if re.search(r'.*', pr_body, re.DOTALL): - updated_body = re.sub( - r'.*', - new_benchmark_section, - pr_body, - flags=re.DOTALL - ) - else: - updated_body = f"{pr_body}\n\n{new_benchmark_section}" if len(pr_body) > 0 else new_benchmark_section + # if re.search(r'.*', pr_body, re.DOTALL): + # updated_body = re.sub( + # r'.*', + # new_benchmark_section, + # pr_body, + # flags=re.DOTALL + # ) + # else: + updated_body = f"{pr_body}\n\n{new_benchmark_section}" if len(pr_body) > 0 else new_benchmark_section update_pr_description(REPO_OWNER, REPO_NAME, PR_NUMBER, updated_body) print("PR description updated successfully.")