diff --git a/.github/actions/bootstrap/action.yaml b/.github/actions/bootstrap/action.yaml index 6af68a7..51f71ff 100644 --- a/.github/actions/bootstrap/action.yaml +++ b/.github/actions/bootstrap/action.yaml @@ -4,8 +4,10 @@ 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 @@ -13,7 +15,7 @@ inputs: 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 @@ -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 @@ -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' @@ -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 diff --git a/make/go.mod b/make/go.mod index 962388f..26a0464 100644 --- a/make/go.mod +++ b/make/go.mod @@ -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 diff --git a/make/go.sum b/make/go.sum index 3fc5745..b15f275 100644 --- a/make/go.sum +++ b/make/go.sum @@ -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=