From ad8ec949dd3b32d83057d4dd9a9fedfc06f02a04 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 14 Sep 2026 12:40:47 +0000 Subject: [PATCH] Write benchmark results where the workflow looks for them [patch] The Benchmarks workflow has never published an artifact. BenchmarkDotNet writes its reports below the working directory, and `dotnet run --project` leaves that at the repository root rather than moving into the project, so the reports landed in ./BenchmarkDotNet.Artifacts/results while the summary and upload steps looked in PreciseNumber.Benchmarks/BenchmarkDotNet.Artifacts/results. All four runs so far succeeded and uploaded nothing; the most recent spent thirteen minutes benchmarking and ended with "No files were found with the provided path". The run step now passes --artifacts explicitly, so the location is stated rather than inherited from whatever the working directory happens to be, and the summary and upload steps read that same path. if-no-files-found is also raised from warn to error. The upload step warning was the only sign this was broken, and a warning on a green run is what let it go unnoticed across four runs. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_017jrnV7N94UGL8fDRRE8Xt8 --- .github/workflows/benchmarks.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 00acda4..21b048d 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -62,6 +62,11 @@ jobs: if [ "$BENCHMARK_JOB" != "default" ]; then args+=(--job "$BENCHMARK_JOB") fi + # --artifacts is what decides where the reports land. Without it BenchmarkDotNet + # writes them below the working directory, which `dotnet run --project` leaves at the + # repository root rather than moving to the project -- so the later steps looked under + # PreciseNumber.Benchmarks/ and found nothing, and every run uploaded no artifact. + args+=(--artifacts "$GITHUB_WORKSPACE/BenchmarkDotNet.Artifacts") dotnet run -c Release --project PreciseNumber.Benchmarks -- "${args[@]}" # The Markdown reports are the readable artifact; the JSON is what a later comparison @@ -71,7 +76,7 @@ jobs: shell: bash run: | shopt -s nullglob - reports=(PreciseNumber.Benchmarks/BenchmarkDotNet.Artifacts/results/*-report-github.md) + reports=(BenchmarkDotNet.Artifacts/results/*-report-github.md) if [ ${#reports[@]} -eq 0 ]; then echo "No benchmark reports were produced." >> "$GITHUB_STEP_SUMMARY" exit 0 @@ -86,6 +91,6 @@ jobs: uses: actions/upload-artifact@v7 with: name: benchmark-results-${{ github.sha }} - path: PreciseNumber.Benchmarks/BenchmarkDotNet.Artifacts/results/* + path: BenchmarkDotNet.Artifacts/results/* retention-days: 30 - if-no-files-found: warn + if-no-files-found: error