Skip to content

Commit cad4af9

Browse files
committed
Target current branch instead of main in dump-perf-baseline CI workflow
1 parent ba545cb commit cad4af9

File tree

3 files changed

+44
-13
lines changed

3 files changed

+44
-13
lines changed

.github/workflows/dump-perf-baseline.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,45 @@ jobs:
88
dump_and_commit:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
11+
- name: Checkout (current branch)
12+
uses: actions/checkout@v4
1213
with:
13-
ref: main
14+
ref: ${{ github.ref_name }}
1415
submodules: recursive
15-
- name: build
16+
- name: Build
1617
uses: ./.github/actions/build
1718
- name: Performance Regression (dump)
18-
uses: ./.github/actions/perf-regression
1919
env:
2020
TEST_TYPE: Performance Regression
21-
with:
22-
mode: dump
21+
PERF_MODE: --dump
22+
run: |
23+
set -euo pipefail
24+
sh run-ci-tests.sh
25+
- name: Commit and push baseline to current branch
26+
shell: bash
27+
env:
28+
BASELINE_PATH: tests/perf-regression/perf-regression.json
29+
BRANCH_NAME: ${{ github.ref_name }}
30+
run: |
31+
set -euo pipefail
32+
33+
if [[ ! -f "$BASELINE_PATH" ]]; then
34+
echo "ERROR: baseline not found at $BASELINE_PATH"
35+
exit 1
36+
fi
37+
38+
# Configure git identity
39+
git config user.name "github-actions[bot]"
40+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
41+
42+
# Commit only if baseline changed
43+
if git diff --quiet -- "$BASELINE_PATH"; then
44+
echo "No changes in $BASELINE_PATH; nothing to commit."
45+
exit 0
46+
fi
47+
48+
git add "$BASELINE_PATH"
49+
git commit -m "ci(perf): update baseline $BASELINE_PATH"
50+
# Push back to the same branch this workflow was dispatched on
51+
git push origin HEAD:"$BRANCH_NAME"
52+
echo "Baseline committed and pushed to branch: $BRANCH_NAME"

tests/perf-regression/dump-perf-ci.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
set -euo pipefail
33

44
WF_FILE="dump-perf-baseline.yml"
5-
BRANCH="main"
5+
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
66

7-
echo "Triggering '$WF_FILE' on $BRANCH to dump and commit the performance baseline..."
7+
echo "🚀 Triggering '$WF_FILE' on branch '$BRANCH' to dump and commit the performance baseline..."
88
gh workflow run "$WF_FILE" -r "$BRANCH"
99

10-
echo "Dispatched. Pull when the run finishes:"
11-
echo " git pull origin $BRANCH"
10+
echo ""
11+
echo "✅ Workflow dispatched. Once it finishes, pull the updated baseline with:"
12+
echo " git pull origin '$BRANCH'"

tests/perf-regression/perf-regression.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"rows": 1,
7373
"digest": "2a840c03f4e37242a8056a4aa536358c",
7474
"proveTime": 28.83372576500001,
75-
"verifyTime": 1.8026225459999987
75+
"verifyTime": 2.112310
7676
}
7777
}
7878
},
@@ -215,12 +215,12 @@
215215
},
216216
"Basic": {
217217
"digest": "Basic",
218-
"compileTime": 0.000008105000000796282,
218+
"compileTime": 0.000012105000000796282,
219219
"methods": {}
220220
},
221221
"Crypto": {
222222
"digest": "Crypto",
223-
"compileTime": 0.000006472000008216128,
223+
"compileTime": 0.000010472000008216128,
224224
"methods": {}
225225
}
226226
}

0 commit comments

Comments
 (0)