Skip to content
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

Run benchmarks in the correct context and compare main vs PR #28

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

dwmunster
Copy link
Contributor

@dwmunster dwmunster commented Jun 4, 2024

Overview

This PR attempts to fix two issues:

  • Running the benchmarks against main and the PR to ease comparisons.
  • Currently, the benchmarks seem to run against main, not the PR.

Details

This PR splits the benchmarking workflow into two pieces:

  • A workflow that runs in the pull_request context (i.e., from the fork) that executes the code and uploads the results.
  • A workflow that runs in the workflow_run context (i.e., from CADmium-Co/ISOtope) that downloads the results and prints them in a comment.

Running untrusted code is recommended in the pull_request context since it runs in the context of the fork and, thus, would have no access to any secrets or other branches. The workflow_run piece is necessary to post the comment since the action running in the pull_request context has read-only permissions and is unable to post/edit comments on the PR.

@dwmunster dwmunster marked this pull request as draft June 4, 2024 00:17
@dwmunster dwmunster force-pushed the bugfix/benchmark-actions branch 2 times, most recently from dd8e457 to aaabe5f Compare June 4, 2024 00:43
@dwmunster
Copy link
Contributor Author

The original version, which was force-pushed away, was generated with the "help" of AI and didn't actually work. The version present now is based on the Bencher docs.

@dwmunster dwmunster changed the title Run github actions in the correct context and compare main vs PR Run benchmarks in the correct context and compare main vs PR Jun 4, 2024
@dwmunster dwmunster marked this pull request as ready for review June 4, 2024 00:56
Copy link
Contributor

@bo0tzz bo0tzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I don't see any problems here, but I've left a few comments with just some notes about different ways I would approach some things and such. Up to you if you feel like including any of those :)

.github/workflows/benchmarks_run.yml Outdated Show resolved Hide resolved
.github/workflows/benchmarks_run.yml Show resolved Hide resolved
.github/workflows/benchmarks_run.yml Outdated Show resolved Hide resolved
.github/workflows/benchmarks_comment.yml Show resolved Hide resolved
.github/workflows/benchmarks_comment.yml Show resolved Hide resolved
@dwmunster
Copy link
Contributor Author

Definitely appreciate the review @bo0tzz!

@av8ta av8ta merged commit 9748774 into CADmium-Co:main Jun 4, 2024
5 of 6 checks passed
dwmunster added a commit to dwmunster/ISOtope that referenced this pull request Jun 4, 2024
…-Co#28)

* Split benchmarks into a run and a comment workflow

* Use explicit paths rather than glob for benchmark results

Co-authored-by: bo0tzz <[email protected]>

* Benchmark: Use default pull_request events

---------

Co-authored-by: bo0tzz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants