workflows/eval: add markdown of added, removed and changed (#360339)
This commit is contained in:
2
.github/workflows/eval.yml
vendored
2
.github/workflows/eval.yml
vendored
@@ -210,7 +210,7 @@ jobs:
|
||||
--arg beforeResultDir ./baseResult \
|
||||
--arg afterResultDir ./prResult \
|
||||
-o comparison
|
||||
|
||||
cat comparison/step-summary.md >> "$GITHUB_STEP_SUMMARY"
|
||||
# TODO: Request reviews from maintainers for packages whose files are modified in the PR
|
||||
|
||||
- name: Upload the combined results
|
||||
|
||||
@@ -261,6 +261,7 @@ let
|
||||
--slurpfile after ${afterResultDir}/outpaths.json \
|
||||
> $out/changed-paths.json
|
||||
|
||||
jq -r -f ${./generate-step-summary.jq} < $out/changed-paths.json > $out/step-summary.md
|
||||
# TODO: Compare eval stats
|
||||
'';
|
||||
|
||||
|
||||
15
ci/eval/generate-step-summary.jq
Normal file
15
ci/eval/generate-step-summary.jq
Normal file
@@ -0,0 +1,15 @@
|
||||
def truncate(xs; n):
|
||||
if xs | length > n then xs[:n] + ["..."]
|
||||
else xs
|
||||
end;
|
||||
|
||||
def itemize_packages(xs):
|
||||
# we truncate the list to stay below the GitHub limit of 1MB per step summary.
|
||||
truncate(xs; 3000) | map("- [\(.)](https://search.nixos.org/packages?channel=unstable&show=\(.)&from=0&size=50&sort=relevance&type=packages&query=\(.))") | join("\n");
|
||||
|
||||
def section(title; xs):
|
||||
"<details> <summary>" + title + " (" + (xs | length | tostring) + ")</summary>\n\n" + itemize_packages(xs) + "</details>";
|
||||
|
||||
section("Added packages"; .attrdiff.added) + "\n\n" +
|
||||
section("Removed packages"; .attrdiff.removed) + "\n\n" +
|
||||
section("Changed packages"; .attrdiff.changed)
|
||||
Reference in New Issue
Block a user