-
Notifications
You must be signed in to change notification settings - Fork 162
Add performance regression tests to CI #2548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Shigoto-dev19
wants to merge
14
commits into
main
Choose a base branch
from
shigoto/performance-regression-ci-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b0568fc
Add performance regression tests to CI
Shigoto-dev19 e512d76
Fix performance regression check in CI by downloading the baseline
Shigoto-dev19 55e2072
Prettify logs for zkprograms performance regression check
Shigoto-dev19 08b2fb1
Prettify logs and adjust tolerances for zkApp and CS performance regr…
Shigoto-dev19 4702ace
Refactor performance regression CI tests into unified composite action
Shigoto-dev19 8ba94f2
Refine naming in performance regression CI action
Shigoto-dev19 d15de7f
Make performance regression CI checks use main as baseline source
Shigoto-dev19 ae06a44
Replace perf-regression CI action with a separate workflow to dump pe…
Shigoto-dev19 6130696
Update checks.yml
Shigoto-dev19 de1d6ce
Add a new script to trigger CI to dump performance regression baseline
Shigoto-dev19 ec2b69d
Merge branch 'main' into shigoto/performance-regression-ci-tests
Shigoto-dev19 13c4720
Merge branch 'main' into shigoto/performance-regression-ci-tests
Shigoto-dev19 ba545cb
Amend tolerances for ZkProgram compile time regression testing
Shigoto-dev19 cad4af9
Target current branch instead of main in dump-perf-baseline CI workflow
Shigoto-dev19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Dump Performance Regression Baseline | ||
on: | ||
workflow_dispatch: {} | ||
|
||
permissions: | ||
contents: write | ||
jobs: | ||
dump_and_commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout (current branch) | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref_name }} | ||
submodules: recursive | ||
- name: Build | ||
uses: ./.github/actions/build | ||
- name: Performance Regression (dump) | ||
env: | ||
TEST_TYPE: Performance Regression | ||
PERF_MODE: --dump | ||
run: | | ||
set -euo pipefail | ||
sh run-ci-tests.sh | ||
- name: Commit and push baseline to current branch | ||
shell: bash | ||
env: | ||
BASELINE_PATH: tests/perf-regression/perf-regression.json | ||
BRANCH_NAME: ${{ github.ref_name }} | ||
run: | | ||
set -euo pipefail | ||
|
||
if [[ ! -f "$BASELINE_PATH" ]]; then | ||
echo "ERROR: baseline not found at $BASELINE_PATH" | ||
exit 1 | ||
fi | ||
|
||
# Configure git identity | ||
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
||
# Commit only if baseline changed | ||
if git diff --quiet -- "$BASELINE_PATH"; then | ||
echo "No changes in $BASELINE_PATH; nothing to commit." | ||
exit 0 | ||
fi | ||
|
||
git add "$BASELINE_PATH" | ||
git commit -m "ci(perf): update baseline $BASELINE_PATH" | ||
# Push back to the same branch this workflow was dispatched on | ||
git push origin HEAD:"$BRANCH_NAME" | ||
echo "Baseline committed and pushed to branch: $BRANCH_NAME" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
WF_FILE="dump-perf-baseline.yml" | ||
BRANCH="$(git rev-parse --abbrev-ref HEAD)" | ||
|
||
echo "🚀 Triggering '$WF_FILE' on branch '$BRANCH' to dump and commit the performance baseline..." | ||
gh workflow run "$WF_FILE" -r "$BRANCH" | ||
|
||
echo "" | ||
echo "✅ Workflow dispatched. Once it finishes, pull the updated baseline with:" | ||
echo " git pull origin '$BRANCH'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is interesting, but is there a reason we need it?
My understanding of GH actions is like this:
We trigger the action -> it calls the bash script
not:
we run the bash code -> it calls the gh workflow
CI is meant to make sure that the scripts we can run locally stays running, hence "Continuous" of "Continuous Integration"
request: delete this file, since all it does it call
gh workflow run
(with preset flags, butman gh
should take care of that if necessary).if it's meant to be manual, just direct people to the web interface and have them call the action manually (since workflow_dispatch is available as a trigger)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an anecdotal aside just to make sure I'm thinking about it the right way:
given the question: would you write a script to encode how we call
git
on our repository so everyone can do it the same way?my answer would be: no, unless you need to chain multiple brittle
git
invocations in a row.so in this case, I would probably only write a script for it if you need to run multiple
git
commands in a row.I think this PR is fine without this script at all 📦