From 1581bb05599a68a88005a48e49d0c882d95fa51b Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Sun, 24 Aug 2025 21:46:03 -0400 Subject: [PATCH] Do not use the tool-cache by default --- .github/workflows/integration.yml | 10 --------- action.yml | 13 +++++------- package-lock.json | 34 +++++++++++++++++++++++-------- package.json | 2 +- src/main.ts | 4 ++-- 5 files changed, 33 insertions(+), 30 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index ad5ea9f9e..78e7faf6c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -46,28 +46,24 @@ jobs: uses: './' with: skip_install: true - skip_tool_cache: true # Constraint installation - name: 'Install constraint' uses: './' with: version: '>= 1.0.0' - skip_tool_cache: true # Default installation - name: 'Install version' uses: './' with: version: '374.0.0' - skip_tool_cache: true # Latest installation - name: 'Install latest' uses: './' with: version: 'latest' - skip_tool_cache: true # By default, there is no configuration - name: 'Check defaults' @@ -81,7 +77,6 @@ jobs: uses: './' with: install_components: 'cloud-run-proxy' - skip_tool_cache: true - name: 'Check components' run: 'npm run integration' @@ -93,7 +88,6 @@ jobs: uses: './' with: project_id: '${{ vars.PROJECT_ID }}' - skip_tool_cache: true - name: 'Check project ID' run: 'npm run integration' @@ -109,8 +103,6 @@ jobs: - name: 'Setup gcloud with WIF' uses: './' - with: - skip_tool_cache: true - name: 'Check WIF authentication' run: 'npm run integration' @@ -126,8 +118,6 @@ jobs: - name: 'Setup gcloud with SAKE' uses: './' - with: - skip_tool_cache: true - name: 'Check SAKE authentication' run: 'npm run integration' diff --git a/action.yml b/action.yml index 80e382678..84a2549a9 100644 --- a/action.yml +++ b/action.yml @@ -77,15 +77,12 @@ inputs: default: false required: false - skip_tool_cache: + cache: description: |- - Skip transferring the downloaded artifacts into the runner's tool cache. - On GitHub-managed runners, this makes no difference since they are - ephemeral. On self-hosted runners, this controls whether the downloads are - cached stored on the disk. - - For backwards-compatibility, this is is "false" by default. Setting the - value to "true" can significantly speed up installation times. + Transfer the downloaded artifacts into the runner's tool cache. On + GitHub-managed runners, this have very little impact since runneres are + ephemeral. On self-hosted runners, this could improve future runs by + skipping future gcloud installations. default: false required: false diff --git a/package-lock.json b/package-lock.json index 572398eb8..0d262ef34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@actions/core": "^1.11.1", "@actions/tool-cache": "^2.0.2", "@google-github-actions/actions-utils": "^0.8.10", - "@google-github-actions/setup-cloud-sdk": "^1.2.3" + "@google-github-actions/setup-cloud-sdk": "^2.0.0" }, "devDependencies": { "@eslint/eslintrc": "^3.3.1", @@ -30,8 +30,8 @@ "typescript-eslint": "^8.40.0" }, "engines": { - "node": ">= 20.x", - "npm": ">= 10.x" + "node": ">= 24.x", + "npm": ">= 11.x" } }, "node_modules/@actions/core": { @@ -249,21 +249,37 @@ } }, "node_modules/@google-github-actions/setup-cloud-sdk": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@google-github-actions/setup-cloud-sdk/-/setup-cloud-sdk-1.2.3.tgz", - "integrity": "sha512-6k+yIVvxqkp21LMaxytVvIrnyvvLBH5ezKePkIxoFBvcKIOTTpf7L5B5KlMBUHzyjTsNIohtu5iHg+AEBAD8ug==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@google-github-actions/setup-cloud-sdk/-/setup-cloud-sdk-2.0.0.tgz", + "integrity": "sha512-ZrfolwXPE3C2kzyunxeb77TtUQv765aIG2LD7lGXtA9q4WRBoo5xj1I1Mu9d/od2tKvhFh2RwSiRxdBvZMcfxQ==", "license": "Apache-2.0", "dependencies": { "@actions/core": "^1.11.1", "@actions/exec": "^1.1.1", "@actions/http-client": "^2.2.3", "@actions/tool-cache": "^2.0.2", - "@google-github-actions/actions-utils": "^0.8.10", + "@google-github-actions/actions-utils": "^1.0.1", "semver": "^7.7.2" }, "engines": { - "node": ">= 20.x", - "npm": ">= 10.x" + "node": ">= 24.x", + "npm": ">= 11.x" + } + }, + "node_modules/@google-github-actions/setup-cloud-sdk/node_modules/@google-github-actions/actions-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@google-github-actions/actions-utils/-/actions-utils-1.0.1.tgz", + "integrity": "sha512-dEvNcy63a6pkcMsRhWbfjNePsv4kR61O56mQ9rVXvRgjAvRkZTBiM1G7QSnHulMEjhLIlTEGlBIKEKIxCoonkQ==", + "license": "Apache-2.0", + "dependencies": { + "yaml": "^2.8.1" + }, + "bin": { + "actions-gen-readme": "bin/actions-gen-readme.mjs" + }, + "engines": { + "node": ">= 24.x", + "npm": ">= 11.x" } }, "node_modules/@google-github-actions/setup-cloud-sdk/node_modules/semver": { diff --git a/package.json b/package.json index 2d2b217ba..67c6053b0 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@actions/core": "^1.11.1", "@actions/tool-cache": "^2.0.2", "@google-github-actions/actions-utils": "^0.8.10", - "@google-github-actions/setup-cloud-sdk": "^1.2.3" + "@google-github-actions/setup-cloud-sdk": "^2.0.0" }, "devDependencies": { "@eslint/eslintrc": "^3.3.1", diff --git a/src/main.ts b/src/main.ts index bc42e1cee..b4ae4361f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -56,7 +56,7 @@ export async function run(): Promise { let version = presence(core.getInput('version')); const components = core.getInput('install_components'); const projectId = core.getInput('project_id'); - const skipToolCache = parseBoolean(core.getInput('skip_tool_cache')); + const cache = parseBoolean(core.getInput('cache')); if (skipInstall) { core.info(`Skipping installation ("skip_install" was true)`); @@ -91,7 +91,7 @@ export async function run(): Promise { core.addPath(path.join(toolPath, 'bin')); } else { core.debug(`no version of gcloud matching "${version}" is installed`); - await installGcloudSDK(version, skipToolCache); + await installGcloudSDK(version, cache); } }