From d41a6b2070574d6921dcf071ba22b1c9a6db4407 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Mon, 7 Jul 2025 18:55:26 +0200 Subject: [PATCH 1/3] ci: rename baseline benchmark branch --- .github/workflows/ci.yml | 4 ++-- scripts/ci_run_benchmark.sh | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f713aa99..aeb8dc56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,11 +116,11 @@ jobs: - name: Checkout current PR uses: actions/checkout@v4 - - name: Checkout main branch + - name: Checkout baseline branch uses: actions/checkout@v4 with: ref: main - path: _canbench_main_branch + path: _canbench_baseline_branch - uses: actions/cache@v4 with: diff --git a/scripts/ci_run_benchmark.sh b/scripts/ci_run_benchmark.sh index 3e786f34..af5e4247 100644 --- a/scripts/ci_run_benchmark.sh +++ b/scripts/ci_run_benchmark.sh @@ -13,13 +13,13 @@ CANBENCH_JOB_NAME=$2 # Must match the file path specified in the GitHub Action. COMMENT_MESSAGE_PATH=/tmp/canbench_result_${CANBENCH_JOB_NAME} -# GitHub CI is expected to have the main branch checked out in this folder. -MAIN_BRANCH_DIR=_canbench_main_branch +# GitHub CI is expected to have the baseline branch checked out in this folder. +BASELINE_BRANCH_DIR=_canbench_baseline_branch CANBENCH_OUTPUT=/tmp/canbench_output.txt CANBENCH_RESULTS_FILE="$CANISTER_PATH/canbench_results.yml" -MAIN_BRANCH_RESULTS_FILE="$MAIN_BRANCH_DIR/$CANBENCH_RESULTS_FILE" +BASELINE_BRANCH_RESULTS_FILE="$BASELINE_BRANCH_DIR/$CANBENCH_RESULTS_FILE" CANBENCH_RESULTS_CSV_FILE="/tmp/canbench_results_${CANBENCH_JOB_NAME}.csv" @@ -78,12 +78,12 @@ time=$(date -u +"%Y-%m-%d %H:%M:%S UTC") # Print output with correct formatting echo "# \`canbench\` 🏋 (dir: $CANISTER_PATH) $commit_hash $time" > "$COMMENT_MESSAGE_PATH" -# Check for performance changes relative to the main branch. -if [ -f "$MAIN_BRANCH_RESULTS_FILE" ]; then - # Replace the current results with the main branch results. - mv "$MAIN_BRANCH_RESULTS_FILE" "$CANBENCH_RESULTS_FILE" +# Check for performance changes relative to the baseline branch. +if [ -f "$BASELINE_BRANCH_RESULTS_FILE" ]; then + # Replace the current results with the baseline branch results. + mv "$BASELINE_BRANCH_RESULTS_FILE" "$CANBENCH_RESULTS_FILE" - # Run canbench to compare results with the main branch. + # Run canbench to compare results with the baseline branch. pushd "$CANISTER_PATH" canbench --less-verbose --hide-results --show-summary --csv > "$CANBENCH_OUTPUT" cp "./canbench_results.csv" "$CANBENCH_RESULTS_CSV_FILE" From a43c6ed5aa56eb8233284c744ebdb231b629ed4e Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Mon, 7 Jul 2025 19:14:31 +0200 Subject: [PATCH 2/3] compare against v0.6.7 branch --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aeb8dc56..caac6c43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,8 @@ jobs: - name: Checkout baseline branch uses: actions/checkout@v4 with: - ref: main + #ref: main + ref: maksym/baseline-v0.6.7 path: _canbench_baseline_branch - uses: actions/cache@v4 From 9667208197caab88f8a9bd9774283a852b2e4a36 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Mon, 7 Jul 2025 19:30:19 +0200 Subject: [PATCH 3/3] revert 0.6.7 --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caac6c43..aeb8dc56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,8 +119,7 @@ jobs: - name: Checkout baseline branch uses: actions/checkout@v4 with: - #ref: main - ref: maksym/baseline-v0.6.7 + ref: main path: _canbench_baseline_branch - uses: actions/cache@v4