Skip to content

Commit

Permalink
chore: update bootstrap action
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Zantow <[email protected]>
  • Loading branch information
kzantow committed Oct 23, 2024
1 parent 0f951d0 commit c28d042
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
23 changes: 8 additions & 15 deletions .github/actions/bootstrap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ description: "Bootstrap all tools and dependencies"
inputs:
go-version:
description: "Go version to install"
required: true
default: "1.21.x"
required: false
go-version-file:
description: "Go mod file to get go version to install"
required: false
use-go-cache:
description: "Restore go cache"
required: true
default: "true"
cache-key-prefix:
description: "Prefix all cache keys with this value"
required: true
default: "831180ac25"
default: "831180ac26"
build-cache-key-prefix:
description: "Prefix build cache key with this value"
required: true
Expand All @@ -25,15 +27,16 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #v4.1.0
- uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
go-version-file: ${{ inputs.go-version-file }}

- name: Restore tool cache
id: tool-cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2
with:
path: ${{ github.workspace }}/.tmp
path: ${{ github.workspace }}/.tool
key: ${{ inputs.cache-key-prefix }}-${{ runner.os }}-tool-${{ hashFiles('Makefile') }}

# note: we need to keep restoring the go mod cache before bootstrapping tools since `go install` is used in
Expand All @@ -49,11 +52,6 @@ runs:
restore-keys: |
${{ inputs.cache-key-prefix }}-${{ runner.os }}-go-mod-${{ inputs.go-version }}-
- name: (cache-miss) Bootstrap project tools
shell: bash
if: steps.tool-cache.outputs.cache-hit != 'true'
run: make bootstrap-tools

- name: Restore go build cache
id: go-cache
if: inputs.use-go-cache == 'true'
Expand All @@ -65,11 +63,6 @@ runs:
restore-keys: |
${{ inputs.cache-key-prefix }}-${{ inputs.build-cache-key-prefix }}-${{ runner.os }}-go-build-${{ inputs.go-version }}-
- name: (cache-miss) Bootstrap go dependencies
shell: bash
if: steps.go-mod-cache.outputs.cache-hit != 'true' && inputs.use-go-cache == 'true'
run: make bootstrap-go

- name: Install apt packages
if: inputs.bootstrap-apt-packages != ''
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion make/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/anchore/chronicle/make

go 1.22.1

require github.com/anchore/go-make v0.0.0-20241022203551-494d90ce1a4a
require github.com/anchore/go-make v0.0.0-20241023195051-94aca613f855

require (
github.com/kr/text v0.2.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions make/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/anchore/go-make v0.0.0-20241021192429-7e18af0fc7f9 h1:LvLPfZd31lsrqw5
github.com/anchore/go-make v0.0.0-20241021192429-7e18af0fc7f9/go.mod h1:y2KCL40/pLMqMu5PGqxGUs/1taaQjZVkuCGXFi9Lcic=
github.com/anchore/go-make v0.0.0-20241022203551-494d90ce1a4a h1:ttcnRZCKhNWkBem7L4HVk60lVx2HwWPjOPX9NH9/LuQ=
github.com/anchore/go-make v0.0.0-20241022203551-494d90ce1a4a/go.mod h1:y2KCL40/pLMqMu5PGqxGUs/1taaQjZVkuCGXFi9Lcic=
github.com/anchore/go-make v0.0.0-20241023195051-94aca613f855 h1:/HOfJkk2BEYp1HTQjlyLq0VY6lC5LAcS3jhgFajwIUM=
github.com/anchore/go-make v0.0.0-20241023195051-94aca613f855/go.mod h1:y2KCL40/pLMqMu5PGqxGUs/1taaQjZVkuCGXFi9Lcic=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
Expand Down

0 comments on commit c28d042

Please sign in to comment.