Skip to content

Commit fa38c6d

Browse files
wip
1 parent 43a88a2 commit fa38c6d

File tree

2 files changed

+48
-12
lines changed

2 files changed

+48
-12
lines changed

.github/workflows/committer_ci.yml

+45-12
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,50 @@ jobs:
103103

104104
- run: echo BENCHES_RESULT=$(cat bench_new.txt) >> $GITHUB_ENV
105105

106-
# Post comment in case of performance regression or improvement.
107106
- run: npm install fs
108-
- if: contains(env.BENCHES_RESULT, 'regressed') || contains(env.BENCHES_RESULT, 'improved')
109-
uses: actions/github-script@v6
107+
108+
# Comment with a link to the workflow (or update existing comment on rerun).
109+
- name: Find Comment
110+
if: github.event_name == 'pull_request'
111+
uses: starkware-libs/find-comment@v3
112+
id: find-benchmark-comment
113+
with:
114+
token: ${{ secrets.GITHUB_TOKEN }}
115+
issue-number: ${{ github.event.pull_request.number }}
116+
comment-author: 'github-actions[bot]'
117+
body-includes: Benchmark movements
118+
119+
- name: Create comment
120+
# If the PR number is found and the comment is not found, create a new comment.
121+
if: (contains(env.BENCHES_RESULT, 'regressed') || contains(env.BENCHES_RESULT, 'improved')) && github.event_name == 'pull_request' && steps.find-benchmark-comment.outputs.comment-id == ''
122+
uses: starkware-libs/create-or-update-comment@v4
123+
with:
124+
token: ${{ secrets.GITHUB_TOKEN }}
125+
issue-number: ${{ github.event.pull_request.number }}
126+
body: $(fs.readFileSync('bench_new.txt', 'utf8')),
127+
128+
- name: Update comment
129+
# If the PR number is found and the comment exists, update it.
130+
if: (contains(env.BENCHES_RESULT, 'regressed') || contains(env.BENCHES_RESULT, 'improved')) && github.event_name == 'pull_request' && steps.find-benchmark-comment.outputs.comment-id != ''
131+
uses: starkware-libs/create-or-update-comment@v4
110132
with:
111-
script: |
112-
const fs = require('fs')
113-
github.rest.issues.createComment({
114-
issue_number: context.issue.number,
115-
owner: context.repo.owner,
116-
repo: context.repo.repo,
117-
body: fs.readFileSync('bench_new.txt', 'utf8'),
118-
path: 'Commits'
119-
})
133+
token: ${{ secrets.GITHUB_TOKEN }}
134+
comment-id: ${{ steps.find-benchmark-comment.outputs.comment-id }}
135+
edit-mode: append
136+
body: $(fs.readFileSync('bench_new.txt', 'utf8')),
137+
138+
139+
# # Post comment in case of performance regression or improvement.
140+
# - run: npm install fs
141+
# - if: contains(env.BENCHES_RESULT, 'regressed') || contains(env.BENCHES_RESULT, 'improved')
142+
# uses: actions/github-script@v6
143+
# with:
144+
# script: |
145+
# const fs = require('fs')
146+
# github.rest.issues.createComment({
147+
# issue_number: context.issue.number,
148+
# owner: context.repo.owner,
149+
# repo: context.repo.repo,
150+
# body: fs.readFileSync('bench_new.txt', 'utf8'),
151+
# path: 'Commits'
152+
# })

crates/starknet_patricia/src/patricia_merkle_tree/external_test_utils.rs

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ where
101101
)
102102
.expect("Failed to create the updated skeleton tree");
103103

104+
// wait for 1 minute
105+
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
106+
104107
FilledTreeImpl::<L>::create_with_existing_leaves::<TH>(updated_skeleton, leaf_modifications)
105108
.await
106109
.expect("Failed to create the filled tree")

0 commit comments

Comments
 (0)