Skip to content

Commit d14e16f

Browse files
committed
pretend sticky disks
1 parent 651924f commit d14e16f

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

‎.github/workflows/nix-build.yml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,31 @@ jobs:
100100
set -euo pipefail
101101
echo "NIX_EVAL_JOBS=$(nix build --no-link --print-out-paths github:nix-community/nix-eval-jobs/v2.35.4)/bin/nix-eval-jobs" >>"$GITHUB_ENV"
102102
103+
# Sticky disk writes from PRs are thrown away, so a quick-sticky row would always start with an empty store.
104+
# To stand in for a warm sticky disk, run eval once untimed to fill the store, then time a second run.
105+
# The narinfo cache in ~/.cache/nix is deleted in between, because it would not be on the sticky disk.
106+
# This is a best case: a real sticky disk reads its snapshot over the network the first time each file is used.
107+
- name: Fill the store with an untimed eval
108+
if: matrix.install == 'quick-sticky'
109+
env:
110+
WORKERS: ${{ matrix.limits.workers }}
111+
MAX_MEMORY: ${{ matrix.limits.max_memory }}
112+
run: |
113+
set -euo pipefail
114+
"$NIX_EVAL_JOBS" \
115+
--flake . \
116+
--check-cache-status \
117+
--force-recurse \
118+
--quiet \
119+
--option eval-cache false \
120+
--option accept-flake-config true \
121+
--max-memory-size "$MAX_MEMORY" \
122+
--workers "$WORKERS" \
123+
--select 'outputs: { inherit (outputs) checks legacyPackages; }' \
124+
>/dev/null
125+
rm -rf ~/.cache/nix
126+
echo "STORE=warmed in job ($(find /nix/store -mindepth 1 -maxdepth 1 | wc -l) paths)" >>"$GITHUB_ENV"
127+
103128
# Time flake input fetching and eval together, in one run, the way the eval job does it.
104129
- name: Time eval
105130
env:

0 commit comments

Comments
 (0)