ci: test cache
This commit is contained in:
parent
0a4045761c
commit
ecea98e912
|
@ -22,21 +22,27 @@ jobs:
|
||||||
echo "PATH=$PATH:/usr/local/go/bin" >> $GITHUB_ENV
|
echo "PATH=$PATH:/usr/local/go/bin" >> $GITHUB_ENV
|
||||||
- name: Display Go version
|
- name: Display Go version
|
||||||
run: go version
|
run: go version
|
||||||
- name: Setup Go Cache
|
- name: Get go-hashfiles
|
||||||
id: go-cache-paths
|
uses: https://gitea.com/actions/go-hashfiles@v0.0.1
|
||||||
run: |
|
id: hash-go
|
||||||
echo "::set-output name=go-build::$(go env GOCACHE)"
|
|
||||||
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
|
|
||||||
- name: Go Build Cache
|
|
||||||
uses: https://gitea.com/actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.go-cache-paths.outputs.go-build }}
|
patterns: |-
|
||||||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
go.mod
|
||||||
- name: Go Mod Cache
|
go.sum
|
||||||
uses: https://gitea.com/actions/cache@v2
|
|
||||||
with:
|
- name: Echo hash
|
||||||
path: ${{ steps.go-cache-paths.outputs.go-mod }}
|
run: echo ${{ steps.hash-go.outputs.hash }}
|
||||||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
|
||||||
|
- name: Cache go
|
||||||
|
id: cache-go
|
||||||
|
uses: https://gitea.com/actions/cache@v3 # Action cache
|
||||||
|
with: # specify with your GOMODCACHE and GOCACHE
|
||||||
|
path: |-
|
||||||
|
/root/go/pkg/mod
|
||||||
|
/root/.cache/go-build
|
||||||
|
key: go_cache-${{ steps.hash-go.outputs.hash }}
|
||||||
|
restore-keys: |-
|
||||||
|
go_cache-${{ steps.hash-go.outputs.hash }}
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
go env -w GO111MODULE=on
|
go env -w GO111MODULE=on
|
||||||
|
|
Loading…
Reference in New Issue
Block a user