Skip to content

Commit

Permalink
fix: bench ci (#357)
Browse files Browse the repository at this point in the history
Sometimes, the Cargo.lock will differ between `BASE_SHA` and `HEAD_SHA`.

This can cause the final checkout to `HEAD_SHA` to fail.

This PR resolves that, by resetting any changes prior to the final
checkout.
  • Loading branch information
liamaharon authored and ZanCorDX committed Jan 15, 2025
1 parent 698d95c commit d3a2fca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/ci/benchmark-in-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ function run_benchmark() {

# Switch back to current commit and run benchmarks again
echo "Switching back to $HEAD_SHA_SHORT and running benchmarks ..."
# Reset to ensure any changes (e.g. to Cargo.lock) are discarded before attempting to checkout.
git reset --hard
git checkout $HEAD_SHA
cargo bench --workspace
fi
Expand Down

0 comments on commit d3a2fca

Please sign in to comment.