Skip to content

Commit f7c2918

Browse files
authored
Do not use the tool-cache by default (#724)
1 parent 6387e69 commit f7c2918

File tree

5 files changed

+33
-30
lines changed

5 files changed

+33
-30
lines changed

.github/workflows/integration.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,24 @@ jobs:
4646
uses: './'
4747
with:
4848
skip_install: true
49-
skip_tool_cache: true
5049

5150
# Constraint installation
5251
- name: 'Install constraint'
5352
uses: './'
5453
with:
5554
version: '>= 1.0.0'
56-
skip_tool_cache: true
5755

5856
# Default installation
5957
- name: 'Install version'
6058
uses: './'
6159
with:
6260
version: '374.0.0'
63-
skip_tool_cache: true
6461

6562
# Latest installation
6663
- name: 'Install latest'
6764
uses: './'
6865
with:
6966
version: 'latest'
70-
skip_tool_cache: true
7167

7268
# By default, there is no configuration
7369
- name: 'Check defaults'
@@ -81,7 +77,6 @@ jobs:
8177
uses: './'
8278
with:
8379
install_components: 'cloud-run-proxy'
84-
skip_tool_cache: true
8580

8681
- name: 'Check components'
8782
run: 'npm run integration'
@@ -93,7 +88,6 @@ jobs:
9388
uses: './'
9489
with:
9590
project_id: '${{ vars.PROJECT_ID }}'
96-
skip_tool_cache: true
9791

9892
- name: 'Check project ID'
9993
run: 'npm run integration'
@@ -109,8 +103,6 @@ jobs:
109103

110104
- name: 'Setup gcloud with WIF'
111105
uses: './'
112-
with:
113-
skip_tool_cache: true
114106

115107
- name: 'Check WIF authentication'
116108
run: 'npm run integration'
@@ -126,8 +118,6 @@ jobs:
126118

127119
- name: 'Setup gcloud with SAKE'
128120
uses: './'
129-
with:
130-
skip_tool_cache: true
131121

132122
- name: 'Check SAKE authentication'
133123
run: 'npm run integration'

action.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,12 @@ inputs:
7777
default: false
7878
required: false
7979

80-
skip_tool_cache:
80+
cache:
8181
description: |-
82-
Skip transferring the downloaded artifacts into the runner's tool cache.
83-
On GitHub-managed runners, this makes no difference since they are
84-
ephemeral. On self-hosted runners, this controls whether the downloads are
85-
cached stored on the disk.
86-
87-
For backwards-compatibility, this is is "false" by default. Setting the
88-
value to "true" can significantly speed up installation times.
82+
Transfer the downloaded artifacts into the runner's tool cache. On
83+
GitHub-managed runners, this have very little impact since runneres are
84+
ephemeral. On self-hosted runners, this could improve future runs by
85+
skipping future gcloud installations.
8986
default: false
9087
required: false
9188

package-lock.json

Lines changed: 25 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@actions/core": "^1.11.1",
3434
"@actions/tool-cache": "^2.0.2",
3535
"@google-github-actions/actions-utils": "^0.8.10",
36-
"@google-github-actions/setup-cloud-sdk": "^1.2.3"
36+
"@google-github-actions/setup-cloud-sdk": "^2.0.0"
3737
},
3838
"devDependencies": {
3939
"@eslint/eslintrc": "^3.3.1",

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function run(): Promise<void> {
5656
let version = presence(core.getInput('version'));
5757
const components = core.getInput('install_components');
5858
const projectId = core.getInput('project_id');
59-
const skipToolCache = parseBoolean(core.getInput('skip_tool_cache'));
59+
const cache = parseBoolean(core.getInput('cache'));
6060

6161
if (skipInstall) {
6262
core.info(`Skipping installation ("skip_install" was true)`);
@@ -91,7 +91,7 @@ export async function run(): Promise<void> {
9191
core.addPath(path.join(toolPath, 'bin'));
9292
} else {
9393
core.debug(`no version of gcloud matching "${version}" is installed`);
94-
await installGcloudSDK(version, skipToolCache);
94+
await installGcloudSDK(version, cache);
9595
}
9696
}
9797

0 commit comments

Comments
 (0)