mirror of
https://github.com/actions/setup-go.git
synced 2026-04-08 21:50:04 +00:00
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:
parent
f21630a9ad
commit
cf0b11600c
9 changed files with 198948 additions and 67104 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue