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

Add a workflow input for running benchmarks manually #1698

Merged
merged 6 commits into from
Mar 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
required: true
default: false
type: boolean
force_run_benchmarks:
description: "Run the rust benchmarks"
required: true
default: false
type: boolean

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Cancel previous CI jobs on the same branch
Expand All @@ -36,8 +41,8 @@ jobs:
rs-benchmarks:
name: Rust Criterion benchmarks

# Only save the rs-benchmarks job when a commit gets pushed to main
if: ${{ github.event_name == 'push' }}
# Only run the rs-benchmarks job when a commit gets pushed to main or we manually specify it
if: ${{ github.ref == 'refs/heads/main' || github.event.inputs.force_run_benchmarks }
Copy link
Member Author

Choose a reason for hiding this comment

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

Using ref == 'refs/heads/main' is a bit more inline with the actual spirit than any push.


runs-on: ubuntu-latest-16-cores
container:
Expand Down Expand Up @@ -84,8 +89,9 @@ jobs:
fail-on-alert: true
comment-always: true

# Push and deploy GitHub pages branch automatically
auto-push: true
# Save, results and push to GitHub only on main
save-data-file: ${{ github.ref == 'refs/heads/main' }}
auto-push: ${{ github.ref == 'refs/heads/main' }}
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench
max-items-in-chart: 30
Expand Down