Skip to content

Commit c376720

Browse files
committed
update action
1 parent c09bda6 commit c376720

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/actions/tools/action.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: 'Tools'
22
description: 'Install and cache tools'
3+
4+
inputs:
5+
cache-key-prefix:
6+
description: 'Cache key prefix'
7+
required: false
8+
default: 'ci-tools'
9+
310
runs:
411
using: "composite"
512
steps:
@@ -20,17 +27,17 @@ runs:
2027
with:
2128
path: |
2229
.tools/
23-
key: ci-tools-${{ runner.os }}-${{ runner.arch }}-${{ steps.go_version.outputs.GO_VER }}-${{ hashFiles('tools/go.mod', 'tools/tools.mk') }}
30+
key: ${{ inputs.cache-key-prefix }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.go_version.outputs.GO_VER }}-${{ hashFiles('tools/go.mod', 'tools/tools.mk') }}
2431
restore-keys: |
25-
ci-tools-${{ runner.os }}-${{ runner.arch }}-${{ steps.go_version.outputs.GO_VER }}-
26-
ci-tools-${{ runner.os }}-${{ runner.arch }}-
32+
${{ inputs.cache-key-prefix }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.go_version.outputs.GO_VER }}-
33+
${{ inputs.cache-key-prefix }}-${{ runner.os }}-${{ runner.arch }}-
2734
2835
- name: Install Tools
2936
shell: bash
3037
run: |
3138
mkdir -p .tools/{go-build,go}
3239
GOCACHE="${PWD}/.tools/go-build" GOPATH="${PWD}/.tools/go" make tools
33-
# du -h -d 1 -a ./.tools | sort -h -r
40+
du -h -d 1 -a ./.tools | sort -h -r
3441
3542
# GOCACHE = ~/.cache/go-build
3643
# GOPATH = ~/go

.github/workflows/sub_scripts.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030

3131
- id: tools
3232
uses: ./.github/actions/tools
33+
with:
34+
cache-key-prefix: lint
3335

3436
- name: Check shell files
3537
run: make ci-sh

0 commit comments

Comments
 (0)