Skip to content

Commit 710e216

Browse files
committed
cirrus: fix golangci-lint cache leak
Do not use reupload_on_changes, this will make the cache grow unbound and I have seen the cache become so large then restoring it and uploading it took several minutes thus making the task time worse compared to no cache. I manually cleaned the cache a few times to fix this but it need to properly be fixed here. To not have a stale cache for to long also use date +%U which will create a new cache once a week. This is in line with the offical golangci-lint github action which invalidates the cache every 7 days by default[1]. [1] https://github.com/golangci/golangci-lint-action/blob/main/README.md#cache-invalidation-interval Signed-off-by: Paul Holzinger <[email protected]>
1 parent cf06546 commit 710e216

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

.cirrus.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ validate-source_task:
122122
setup_script: &setup '$GOSRC/$SCRIPT_BASE/setup_environment.sh'
123123
golangci-lint_cache:
124124
folder: /root/.cache/golangci-lint
125-
reupload_on_changes: true
126-
fingerprint_script:
125+
fingerprint_script: &golangci_cache_fingerprint
127126
- go version
128127
- grep GOLANGCI_LINT_VERSION Makefile | head -1
128+
- date +%U
129129
# Standard main execution stage call, used by nearly every task in CI.
130130
main_script: &main '/usr/bin/time --verbose --output="$STATS_LOGFILE" $GOSRC/$SCRIPT_BASE/runner.sh'
131131

@@ -340,10 +340,7 @@ freebsd_alt_build_task:
340340
- go version # Downloads a new go version based on go.mod's go directive.
341341
golint_cache:
342342
folder: ~/.cache/golangci-lint
343-
reupload_on_changes: true
344-
fingerprint_script:
345-
- go version
346-
- grep GOLANGCI_LINT_VERSION Makefile | head -1
343+
fingerprint_script: *golangci_cache_fingerprint
347344
lint_script:
348345
- gmake golangci-lint
349346
build_amd64_script:

0 commit comments

Comments
 (0)