perf: add cache-build option and upgrade to v6.2.0

Add `cache-build` input (default: false) to control whether GOCACHE is
included in the cache. This dramatically reduces cache size from ~1.2GB
to ~200-400MB by excluding build artifacts that have low reuse across
code changes.

Also upgrades dependencies (@actions/cache v5, semver v7.7) and runtime
to node24 to align with upstream actions/setup-go.

https://claude.ai/code/session_01CqrWSjzGgd7Zi6LyJkd9XW
This commit is contained in:
Claude 2026-04-04 17:58:19 +00:00
parent f21630a9ad
commit cf0b11600c
No known key found for this signature in database
9 changed files with 198948 additions and 67104 deletions

View file

@ -4,6 +4,7 @@ import * as glob from '@actions/glob';
import * as cacheRestore from '../src/cache-restore';
import * as cacheUtils from '../src/cache-utils';
import * as hashdir from '../src/hashdir';
import {PackageManagerInfo} from '../src/package-managers';
describe('restoreCache', () => {
@ -21,7 +22,11 @@ describe('restoreCache', () => {
const packageManager = 'default';
const cacheDependencyPath = 'path';
const computeMetaHashSpy = jest.spyOn(hashdir, 'computeMetaHash');
beforeEach(() => {
process.env['INPUT_CACHE-BUILD'] = 'false';
computeMetaHashSpy.mockReturnValue('mock_build_hash');
getCacheDirectoryPathSpy.mockImplementation(
(PackageManager: PackageManagerInfo) => {
return new Promise<string[]>(resolve => {