You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
setup-go/__tests__
maxcleme 49fe0b8fcc
fix: allow multiple invocations with caching enabled
This fix addresses the issue where calling setup-go multiple times with
caching enabled in the same workflow would fail because the second
invocation attempted to save to the same cache key.

Changes:
- Add tracking of processed cache keys using state variables to prevent
  duplicate cache save attempts
- Add helper functions in constants.ts for state management:
  - getAlreadyCachedKey()/setAlreadyCachedKey(): Track keys already in cache
  - getPrimaryCacheKey()/setPrimaryCacheKey(): Track the primary key for
    each invocation
  - getCachedGoModPath()/setCachedGoModPath(): Track which go.mod was cached
- Modify cache-restore.ts to store state about the cache operation
- Modify cache-save.ts to check if cache was already saved for this
  go.mod path before attempting to save again
- Add comprehensive tests for the multiple invocation scenario

This enables workflows that need to setup Go with different configurations
(e.g., different working directories) multiple times without cache
conflicts.

Assisted-By: cagent
2 months ago
..
data Add comprehensive breaking changes documentation for v6 (#674) 5 months ago
cache-restore.test.ts fix: allow multiple invocations with caching enabled 2 months ago
cache-save.test.ts fix: allow multiple invocations with caching enabled 2 months ago
cache-utils.test.ts Update default Go module caching to use go.mod (#705) 3 months ago
setup-go.test.ts Add support for .tool-versions file in setup-go, update workflow (#673) 6 months ago
utils.test.ts Update self-hosted environment validation and bump undici version (#556) 1 year ago
verify-go.sh Use GitHub releases to download Go versions. (#58) 6 years ago
windows-toolcache.test.ts Fix Install on Windows is very slow (#393) 3 years ago