Skip to content

Commit

Permalink
Enable manual GHA benchmark run with custom first_commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
trexfeathers committed Sep 29, 2022
1 parent 04e757f commit b423984
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
schedule:
# Runs every day at 23:00.
- cron: "0 23 * * *"
workflow_dispatch:
inputs:
first_commit:
description: "Argument to be passed to the overnight benchmark script."
required: false
type: string

jobs:
benchmark:
Expand Down Expand Up @@ -64,7 +70,12 @@ jobs:
- name: Run overnight benchmarks
run: |
first_commit=$(git log --after="$(date -d "1 day ago" +"%Y-%m-%d") 23:00:00" --pretty=format:"%h" | tail -n 1)
first_commit=${{ inputs.first_commit }}
if [ "$first_commit" != "" ]
then
first_commit=$(git log --after="$(date -d "1 day ago" +"%Y-%m-%d") 23:00:00" --pretty=format:"%h" | tail -n 1)
fi
if [ "$first_commit" != "" ]
then
nox --session="benchmarks(overnight)" -- $first_commit
Expand Down

0 comments on commit b423984

Please sign in to comment.