mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 09:36:20 +09:00
workflows/eval: consistently avoid "result" in arguments
Everything is a result, especially when nix-build uses "result" as its default output. This becomes confusing, when re-wiring the different parts later. Thus, consistently name those things after some of their properties and avoid the term result.
This commit is contained in:
parent
0e1c284b13
commit
b2579d36ff
3 changed files with 31 additions and 30 deletions
33
.github/workflows/eval.yml
vendored
33
.github/workflows/eval.yml
vendored
|
@ -74,14 +74,15 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
nix-build untrusted/ci -A eval.singleSystem \
|
nix-build untrusted/ci -A eval.singleSystem \
|
||||||
--argstr evalSystem "$MATRIX_SYSTEM" \
|
--argstr evalSystem "$MATRIX_SYSTEM" \
|
||||||
--arg chunkSize 10000
|
--arg chunkSize 10000 \
|
||||||
|
--out-link merged
|
||||||
# If it uses too much memory, slightly decrease chunkSize
|
# If it uses too much memory, slightly decrease chunkSize
|
||||||
|
|
||||||
- name: Upload the output paths and eval stats
|
- name: Upload the output paths and eval stats
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: intermediate-${{ matrix.system }}
|
name: merged-${{ matrix.system }}
|
||||||
path: result/*
|
path: merged/*
|
||||||
|
|
||||||
process:
|
process:
|
||||||
name: Process
|
name: Process
|
||||||
|
@ -93,8 +94,8 @@ jobs:
|
||||||
- name: Download output paths and eval stats for all systems
|
- name: Download output paths and eval stats for all systems
|
||||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||||
with:
|
with:
|
||||||
pattern: intermediate-*
|
pattern: merged-*
|
||||||
path: intermediate
|
path: merged
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Check out the PR at the test merge commit
|
- name: Check out the PR at the test merge commit
|
||||||
|
@ -111,14 +112,14 @@ jobs:
|
||||||
- name: Combine all output paths and eval stats
|
- name: Combine all output paths and eval stats
|
||||||
run: |
|
run: |
|
||||||
nix-build untrusted/ci -A eval.combine \
|
nix-build untrusted/ci -A eval.combine \
|
||||||
--arg resultsDir ./intermediate \
|
--arg evalDir ./merged \
|
||||||
-o prResult
|
--out-link combined
|
||||||
|
|
||||||
- name: Upload the combined results
|
- name: Upload the combined results
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: result
|
name: combined
|
||||||
path: prResult/*
|
path: combined/*
|
||||||
|
|
||||||
- name: Get target run id
|
- name: Get target run id
|
||||||
if: needs.prepare.outputs.targetSha
|
if: needs.prepare.outputs.targetSha
|
||||||
|
@ -156,8 +157,8 @@ jobs:
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
if: steps.targetRunId.outputs.targetRunId
|
if: steps.targetRunId.outputs.targetRunId
|
||||||
with:
|
with:
|
||||||
name: result
|
name: combined
|
||||||
path: targetResult
|
path: target
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
github-token: ${{ github.token }}
|
github-token: ${{ github.token }}
|
||||||
run-id: ${{ steps.targetRunId.outputs.targetRunId }}
|
run-id: ${{ steps.targetRunId.outputs.targetRunId }}
|
||||||
|
@ -174,15 +175,15 @@ jobs:
|
||||||
|
|
||||||
# Use the target branch to get accurate maintainer info
|
# Use the target branch to get accurate maintainer info
|
||||||
nix-build trusted/ci -A eval.compare \
|
nix-build trusted/ci -A eval.compare \
|
||||||
--arg beforeResultDir ./targetResult \
|
--arg beforeDir ./target \
|
||||||
--arg afterResultDir "$(realpath prResult)" \
|
--arg afterDir "$(realpath combined)" \
|
||||||
--arg touchedFilesJson ./touched-files.json \
|
--arg touchedFilesJson ./touched-files.json \
|
||||||
--argstr githubAuthorId "$AUTHOR_ID" \
|
--argstr githubAuthorId "$AUTHOR_ID" \
|
||||||
-o comparison
|
--out-link comparison
|
||||||
|
|
||||||
cat comparison/step-summary.md >> "$GITHUB_STEP_SUMMARY"
|
cat comparison/step-summary.md >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
|
||||||
- name: Upload the combined results
|
- name: Upload the comparison results
|
||||||
if: steps.targetRunId.outputs.targetRunId
|
if: steps.targetRunId.outputs.targetRunId
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
|
@ -211,7 +212,7 @@ jobs:
|
||||||
permission-members: read
|
permission-members: read
|
||||||
permission-pull-requests: write
|
permission-pull-requests: write
|
||||||
|
|
||||||
- name: Download process result
|
- name: Download comparison result
|
||||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||||
with:
|
with:
|
||||||
name: comparison
|
name: comparison
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
python3,
|
python3,
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
beforeResultDir,
|
beforeDir,
|
||||||
afterResultDir,
|
afterDir,
|
||||||
touchedFilesJson,
|
touchedFilesJson,
|
||||||
githubAuthorId,
|
githubAuthorId,
|
||||||
byName ? false,
|
byName ? false,
|
||||||
|
@ -20,7 +20,7 @@ let
|
||||||
|
|
||||||
---
|
---
|
||||||
Inputs:
|
Inputs:
|
||||||
- beforeResultDir, afterResultDir: The evaluation result from before and after the change.
|
- beforeDir, afterDir: The evaluation result from before and after the change.
|
||||||
They can be obtained by running `nix-build -A ci.eval.full` on both revisions.
|
They can be obtained by running `nix-build -A ci.eval.full` on both revisions.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -83,8 +83,8 @@ let
|
||||||
data = builtins.unsafeDiscardStringContext raw;
|
data = builtins.unsafeDiscardStringContext raw;
|
||||||
in
|
in
|
||||||
builtins.fromJSON data;
|
builtins.fromJSON data;
|
||||||
beforeAttrs = getAttrs beforeResultDir;
|
beforeAttrs = getAttrs beforeDir;
|
||||||
afterAttrs = getAttrs afterResultDir;
|
afterAttrs = getAttrs afterDir;
|
||||||
|
|
||||||
# Attrs
|
# Attrs
|
||||||
# - keys: "added", "changed" and "removed"
|
# - keys: "added", "changed" and "removed"
|
||||||
|
@ -149,8 +149,8 @@ runCommand "compare"
|
||||||
maintainers = builtins.toJSON maintainers;
|
maintainers = builtins.toJSON maintainers;
|
||||||
passAsFile = [ "maintainers" ];
|
passAsFile = [ "maintainers" ];
|
||||||
env = {
|
env = {
|
||||||
BEFORE_DIR = "${beforeResultDir}";
|
BEFORE_DIR = "${beforeDir}";
|
||||||
AFTER_DIR = "${afterResultDir}";
|
AFTER_DIR = "${afterDir}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
|
|
|
@ -193,9 +193,9 @@ let
|
||||||
|
|
||||||
combine =
|
combine =
|
||||||
{
|
{
|
||||||
resultsDir,
|
evalDir,
|
||||||
}:
|
}:
|
||||||
runCommand "combined-result"
|
runCommand "combined-eval"
|
||||||
{
|
{
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
jq
|
jq
|
||||||
|
@ -205,11 +205,11 @@ let
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
|
|
||||||
# Combine output paths from all systems
|
# Combine output paths from all systems
|
||||||
cat ${resultsDir}/*/paths.json | jq -s add > $out/outpaths.json
|
cat ${evalDir}/*/paths.json | jq -s add > $out/outpaths.json
|
||||||
|
|
||||||
mkdir -p $out/stats
|
mkdir -p $out/stats
|
||||||
|
|
||||||
for d in ${resultsDir}/*; do
|
for d in ${evalDir}/*; do
|
||||||
cp -r "$d"/stats-by-chunk $out/stats/$(basename "$d")
|
cp -r "$d"/stats-by-chunk $out/stats/$(basename "$d")
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
@ -225,8 +225,8 @@ let
|
||||||
quickTest ? false,
|
quickTest ? false,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
results = symlinkJoin {
|
evals = symlinkJoin {
|
||||||
name = "results";
|
name = "evals";
|
||||||
paths = map (
|
paths = map (
|
||||||
evalSystem:
|
evalSystem:
|
||||||
singleSystem {
|
singleSystem {
|
||||||
|
@ -236,7 +236,7 @@ let
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
combine {
|
combine {
|
||||||
resultsDir = results;
|
evalDir = evals;
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue