-
Notifications
You must be signed in to change notification settings - Fork 181
improve readme and update minimal example #198
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
miparnisari
wants to merge
13
commits into
benchmark-action:master
Choose a base branch
from
miparnisari:fix-readme
base: master
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
13 commits
Select commit
Hold shift + click to select a range
fa49d05
improve readme
miparnisari ca3c561
less permissions
miparnisari bb00a3f
address some comments
miparnisari f0d7aea
undo removal of screenshots
miparnisari 75dcd0d
merge supported tools sections into one
miparnisari b83835a
condense languages
miparnisari 7839b94
Merge branch 'master' into fix-readme
ktrz a5f07e9
Merge remote-tracking branch 'origin/master' into fix-readme
miparnisari e7d61db
Merge remote-tracking branch 'origin/master' into fix-readme
miparnisari f3bac58
update minimal.yml
miparnisari 69b61e7
appease coderabbit
miparnisari 1fe4b3a
update minimal example
miparnisari fa12634
make coderabbit happy
miparnisari 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,41 @@ | ||
| name: Example for minimal setup | ||
| on: | ||
| # NOTE! Do NOT add any other "on", because this workflow has permission to write to the repo! | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| permissions: | ||
| contents: write | ||
| deployments: write | ||
| # permission to update benchmark contents in gh-pages branch | ||
| contents: "write" | ||
|
|
||
| jobs: | ||
| benchmark: | ||
| name: Run minimal steps to run github-action-benchmark | ||
| name: Run benchmark and save results | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v4 | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: "stable" | ||
| - name: Run benchmark | ||
| run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt | ||
| - name: Download previous benchmark data | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ./cache | ||
| key: ${{ runner.os }}-benchmark | ||
| - name: Store benchmark result | ||
| - name: Run benchmark and stores the output to a file | ||
| run: go test ./examples/go -bench 'BenchmarkFib' | tee output.txt | ||
| - name: Get JSON for benchmark | ||
| uses: benchmark-action/github-action-benchmark@v1 | ||
| with: | ||
| # What benchmark tool the output.txt came from | ||
| tool: 'go' | ||
| output-file-path: examples/go/output.txt | ||
| # Where the output from the benchmark tool is stored | ||
| output-file-path: output.txt | ||
| # Updates this file | ||
| external-data-json-path: ./cache/benchmark-data.json | ||
| # Workflow will fail when an alert happens | ||
| fail-on-alert: true | ||
|
Comment on lines
+32
to
33
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm not sure if this line makes sense here. this step isn't comparing benchmark results, so how would it fail? |
||
| # Writes to gh-pages-branch | ||
| auto-push: "true" | ||
| - name: Save JSON in cache | ||
| uses: actions/cache/save@v5 | ||
| with: | ||
| path: ./cache/benchmark-data.json | ||
| # Save with commit hash to avoid "cache already exists" | ||
| key: "${{ github.sha }}-${{ runner.os }}-go-benchmark" | ||
Oops, something went wrong.
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.
i feel like there is a companion minimal example missing: where a PR runs benchmarks and compares them against the benchmarks saved in here...