SIGN IN SIGN UP

CI: hash the NuGet cache key before starting redis, not after (#3209)

The Windows job intermittently fails the cache step with

  hashFiles('Directory.Packages.props, global.json, **/*.csproj') failed.
  Fail to hash files under directory 'D:\a\StackExchange.Redis\StackExchange.Redis'

The expression is fine - the error renders the three arguments comma-joined,
which makes it look like one malformed pattern - and the files are certainly
there, since checkout is the first step and the build a few steps later works.

What is not fine is where the step sits. The key globs the entire workspace for
**/*.csproj, and by line 169 the job has started sixteen redis servers from
inside WSL which are writing into that same tree through DrvFs: rdb files into
RedisConfigs/Temp, nodes-*.conf into RedisConfigs/Cluster, and BGSAVE creating
and renaming temp-<pid>.rdb while the walk is in progress. Enumerating a
directory tree that is changing underneath you is a good way to get exactly this
error, and a good explanation for why it is intermittent rather than constant.

Nothing about restoring NuGet packages needs redis, so do it immediately after
checkout, against a still tree. The key is unchanged, so existing caches remain
valid.
M
Marc Gravell committed
4ec7273a4252c11e183c23ba8dcba466ca09826c
Parent: e42cf88
Committed by GitHub <noreply@github.com> on 9/8/2026, 7:19:06 PM