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

allow benchmark dry-runs in CI #1217

Merged
Merged
Show file tree
Hide file tree
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/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ name: "benchmark"
on:
# Run using manual triggers from GitHub UI:
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch: {}
workflow_dispatch:
inputs:
dryRun:
description: "Attempt a local run and report results here, without updating the bencher dashboard."
type: "boolean"
required: true
default: true

# Run on pushes to 'main' branch:
push:
Expand All @@ -19,8 +25,8 @@ jobs:
benchmark:
runs-on: "ubuntu-22.04" # _SLANG_DEV_CONTAINER_BASE_IMAGE_ (keep in sync)

# Only run on the main repo (not forks):
if: "${{ github.repository == 'NomicFoundation/slang' }}"
# Only run on the main repo (not forks), unless it is a dry run:
if: "${{ github.repository == 'NomicFoundation/slang' || inputs.dryRun == true }}"

steps:
- name: "Checkout Repository"
Expand Down Expand Up @@ -48,7 +54,7 @@ jobs:
- name: "infra perf benchmark"
uses: "./.github/actions/devcontainer/run"
with:
runCmd: "./scripts/bin/infra perf benchmark"
runCmd: "./scripts/bin/infra perf benchmark ${{ inputs.dryRun == true && '--dry-run' || '' }}"
env: |
BENCHER_API_TOKEN=${{ secrets.BENCHER_API_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion crates/infra/cli/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<T: ValueEnum> ClapExtensions for T {

#[derive(Clone, Copy, Debug, Parser)]
pub struct DryRun {
/// Attempt a dry run, instead of actually executing the command.
/// Attempt a local run and report results, without publishing any user-facing artifacts.
#[arg(long)]
dry_run: bool,
}
Expand Down
Loading