Skip to content
Merged
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
11 changes: 7 additions & 4 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,23 @@ jobs:

run() { # run <tree> <artifacts>
echo "::group::$2"
dotnet "$1/$DLL" "${ARGS[@]}" --artifacts "$2"
# Run from inside the tree: BenchmarkDotNet rebuilds the benchmark project it
# finds from the working directory, so running the base build from the head
# checkout would measure the head's code.
(cd "$1" && dotnet "$DLL" "${ARGS[@]}" --artifacts "$2")
echo "::endgroup::"
}

OUT="$RUNNER_TEMP/bdn"
for ((r = 1; r <= ROUNDS; r++)); do
# Alternate the order (base, head, then head, base) so drift cancels out.
if [ "$BASE_BUILT" != "true" ]; then
run . "$OUT/head-$r"
run "$GITHUB_WORKSPACE" "$OUT/head-$r"
elif ((r % 2)); then
run "$RUNNER_TEMP/base" "$OUT/base-$r"
run . "$OUT/head-$r"
run "$GITHUB_WORKSPACE" "$OUT/head-$r"
else
run . "$OUT/head-$r"
run "$GITHUB_WORKSPACE" "$OUT/head-$r"
run "$RUNNER_TEMP/base" "$OUT/base-$r"
fi
done
Expand Down
Loading