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

chore: fix bench workflow for forks #1129

Merged
merged 4 commits into from
Dec 24, 2024
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
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