Skip to content

Commit

Permalink
chore: fix bench workflow for forks (#1129)
Browse files Browse the repository at this point in the history
* chore: fix bench workflow for forks

* Revert "chore: fix bench workflow for forks"

We do want the PR commit and not the default rebased commit.
This reverts commit affbf72.

* chore: add repo name

* fix: no benchmark_id
  • Loading branch information
jonathanpwang authored Dec 24, 2024
1 parent 1942aef commit 62e0741
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/benchmark-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ jobs:

- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}

- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -186,7 +187,7 @@ jobs:
# When uploading to S3, use ${METRIC_NAME}-${current_sha}.[md/json]
- name: Set metric name
run: |
METRIC_NAME=${{ inputs.benchmark_id }}
METRIC_NAME=${{ inputs.benchmark_id || inputs.benchmark_name }}
echo "METRIC_NAME=${METRIC_NAME}" >> $GITHUB_ENV
METRIC_PATH=".bench_metrics/${METRIC_NAME}.json"
echo "METRIC_PATH=${METRIC_PATH}" >> $GITHUB_ENV
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
CARGO_TERM_COLOR: always
OPENVM_FAST_TEST: "1"
CURRENT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
CARGO_NET_GIT_FETCH_WITH_CLI: "true"

permissions:
Expand All @@ -39,7 +40,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}
ref: ${{ CURRENT_SHA }}
repository: ${{ REPO }}

- name: Create benchmark matrix from JSON
id: create-matrix
Expand Down Expand Up @@ -133,7 +135,8 @@ jobs:
##########################################################################
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}
ref: ${{ CURRENT_SHA }}
repository: ${{ REPO }}

- name: Set github pages path for PR
if: github.event_name == 'pull_request'
Expand Down

0 comments on commit 62e0741

Please sign in to comment.