circleci: update cache key to avoid fetching outdated cache

Avoid the following problem:
```
Found a cache from build 55879 at deps-
Size: 178 MiB
Cached paths:
  * /go/pkg/mod

Downloading cache archive...
Validating cache...

Unarchiving cache...

Failed to unarchive cache

Error untarring cache: Error extracting tarball /tmp/cache87609141 : tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com/go: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com/go/@v: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com/go/@v/list: Cannot open: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com/go/@v/list.lock: Cannot open: No such file or directory tar: go: Cannot mkdir: Pe: exit status 2
```
This commit is contained in:
Anna Shaleva 2022-03-24 14:51:02 +03:00
parent a4dab3a5ba
commit 35590f0c96

View file

@ -17,12 +17,12 @@ commands:
gomod:
steps:
- restore_cache:
keys: [deps-]
keys: [deps-v2-]
- run:
name: Download go module dependencies
command: go mod download
- save_cache:
key: deps-{{ checksum "go.sum" }}-{{ checksum "go.sum" }}
key: deps-v2-{{ checksum "go.sum" }}-{{ checksum "go.sum" }}
paths: [/home/circleci/go/pkg/mod]
jobs: