[CI] Keep the vcpkg cache directory guard unconditional (#7527)

The cache action creates its directory only when a prefix matches an entry, and it reads that directory unguarded when it saves, so a scope nobody has written to yet fails the job. Create it up front on every outcome, and fall back to the workspace path when the cache step was skipped and set no path output.

Co-authored-by: opencode <opencode@local>
This commit is contained in:
BruebachL 2026-10-31 18:49:45 +01:00 • committed by GitHub
parent 52d3978f84
commit f2c359ba9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -584,11 +584,17 @@ jobs:
# job. A scope nobody has written to yet therefore leaves the directory missing # job. A scope nobody has written to yet therefore leaves the directory missing
# and fails the job, which is exactly the state every scope starts in. Make the # and fails the job, which is exactly the state every scope starts in. Make the
# directory up front so an empty scope is a cache miss instead of an error. # directory up front so an empty scope is a cache miss instead of an error.
# always() covers the cache step itself failing: the action's post save still runs
# then, and it should report the real error instead of ENOENT. It cannot rescue a
# failure before the cache step, since a post step only runs for an action whose
# main step did. The fallback keeps this guard from failing when the cache step was
# skipped and left no path output.
- name: "Create vcpkg cache directory" - name: "Create vcpkg cache directory"
if: always()
shell: bash shell: bash
env: env:
CACHE_DIR: '${{ steps.vcpkg-cache.outputs.path }}' CACHE_DIR: '${{ steps.vcpkg-cache.outputs.path }}'
run: mkdir -p "$CACHE_DIR" run: mkdir -p "${CACHE_DIR:-$GITHUB_WORKSPACE/.vcpkg-cache}"
# Uses environment variables, see compile.sh for more details # Uses environment variables, see compile.sh for more details
- name: "Build Cockatrice" - name: "Build Cockatrice"