diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index 8e4e8b3..419ed5d 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -22,21 +22,27 @@ jobs: echo "PATH=$PATH:/usr/local/go/bin" >> $GITHUB_ENV - name: Display Go version run: go version - - name: Setup Go Cache - id: go-cache-paths - run: | - 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 + - name: Get go-hashfiles + uses: https://gitea.com/actions/go-hashfiles@v0.0.1 + id: hash-go with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - - name: Go Mod Cache - uses: https://gitea.com/actions/cache@v2 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + patterns: |- + go.mod + go.sum + + - name: Echo hash + run: echo ${{ steps.hash-go.outputs.hash }} + + - 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 run: | go env -w GO111MODULE=on