ci/eval: name base branch in the performance comparison summary (#532477)

This commit is contained in:
Matt Sturgeon 2026-06-17 11:21:16 +00:00 committed by GitHub
commit 0e6663eab9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 2 deletions

View file

@ -15,6 +15,9 @@ on:
targetSha:
required: true
type: string
baseBranch:
required: true
type: string
systems:
required: true
type: string
@ -291,6 +294,7 @@ jobs:
- name: Compare against the target branch
env:
TARGET_SHA: ${{ inputs.mergedSha }}
BASE_BRANCH: ${{ fromJSON(inputs.baseBranch).branch }}
run: |
git -C nixpkgs/trusted diff --name-only "$TARGET_SHA" \
| jq --raw-input --slurp 'split("\n")[:-1]' > touched-files.json
@ -299,6 +303,7 @@ jobs:
nix-build nixpkgs/trusted/ci --arg nixpkgs ./nixpkgs/trusted-pinned -A eval.compare \
--arg combinedDir ./combined \
--arg touchedFilesJson ./touched-files.json \
--argstr baseBranch "$BASE_BRANCH" \
--out-link comparison
cat comparison/step-summary.md >> "$GITHUB_STEP_SUMMARY"

View file

@ -97,6 +97,7 @@ jobs:
artifact-prefix: ${{ inputs.artifact-prefix }}
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
targetSha: ${{ needs.prepare.outputs.targetSha }}
baseBranch: ${{ needs.prepare.outputs.baseBranch }}
systems: ${{ needs.prepare.outputs.systems }}
build:

View file

@ -110,6 +110,7 @@ jobs:
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
headSha: ${{ github.event.pull_request.head.sha }}
targetSha: ${{ needs.prepare.outputs.targetSha }}
baseBranch: ${{ needs.prepare.outputs.baseBranch }}
systems: ${{ needs.prepare.outputs.systems }}
testVersions: ${{ contains(fromJSON(needs.prepare.outputs.touched), 'pinned') && !contains(fromJSON(needs.prepare.outputs.headBranch).type, 'development') }}

View file

@ -49,6 +49,7 @@ in
{
combinedDir,
touchedFilesJson,
baseBranch,
ownersFile ? ../../OWNERS,
}:
let
@ -242,7 +243,7 @@ runCommand "compare"
echo
echo "# Performance comparison"
echo
echo "This compares the performance of this branch against its pull request base branch (e.g., 'master')"
echo "This compares the performance of this branch against the \`${baseBranch}\` branch."
echo
} >> $out/step-summary.md

View file

@ -288,6 +288,9 @@ let
# | jq --raw-input --slurp 'split("\n")[:-1]' > touched-files.json
# ```
touchedFilesJson ? builtins.toFile "touched-files.json" "[ ]",
# The branch the local comparison is made against; matches the `master`
# used in the touched-files expression above.
baseBranch ? "master",
}:
let
diffs = symlinkJoin {
@ -305,7 +308,7 @@ let
};
comparisonReport = compare {
combinedDir = combine { diffDir = diffs; };
inherit touchedFilesJson;
inherit touchedFilesJson baseBranch;
};
in
comparisonReport;