Skip to content

Commit 42e1d91

Browse files
authored
feat: add 'cache-path' parameter to actions/client/install (#115)
This makes the action more flexible so it can be reused by more Workflows other than the buildpack integration test.
1 parent c52662e commit 42e1d91

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/actions/client/install/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ inputs:
77
cache-key:
88
description: 'Cache key for storing client'
99
default: conformance-client-latest
10+
cache-path:
11+
description: 'Filepath where the client is installed'
12+
default: ~/go/bin/client
1013
runs:
1114
using: "composite"
1215
steps:
@@ -17,8 +20,12 @@ runs:
1720
- name: Install client
1821
run: go install github.com/GoogleCloudPlatform/functions-framework-conformance/client@${{ inputs.client-version }}
1922
shell: bash
23+
- name: Move client to cache-path
24+
# 'mv' fails if the src and dest path are the same, so move it to a temp first just in case
25+
run: mv ~/go/bin/client /tmp/client && mv /tmp/client ${{ inputs.cache-path }}
26+
shell: bash
2027
- name: Cache client
2128
uses: actions/cache@v3
2229
with:
23-
path: ~/go/bin/client
30+
path: ${{ inputs.cache-path }}
2431
key: ${{ inputs.cache-key }}

.github/workflows/buildpack-integration-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ jobs:
109109
uses: ./.github/actions/client/install
110110
with:
111111
client-version: ${{ env.CLIENT_VERSION }}
112+
cache-path: ~/go/bin/client
112113
cache-key: ${{ steps.set-cached-client-version.outputs.key }}
113114

114115
run-buildpack-integration-test:

0 commit comments

Comments
 (0)