An open API service indexing awesome lists of open source software.

https://github.com/capnspacehook/cache-go

Github Action to cache Go module and build files more efficiently
https://github.com/capnspacehook/cache-go

cache github-actions go golang

Last synced: 4 months ago
JSON representation

Github Action to cache Go module and build files more efficiently

Awesome Lists containing this project

README

          

# cache-go

Github Action to restore and save cached Go module and build files as efficiently as possible.

Module and build files are cached separately to avoid not restoring cached build files because
dependencies were changed. Likewise a Go version upgrade should not invalidate cached module
files as they aren't dependent on a specific Go version. Cache restore keys are used to ensure
a cache will be loaded whenever possible.

## Inputs

```yaml
mod-key:
description: "An explicit key for restoring and saving the module cache"
required: false
default: ${{ github.job }}-mod-${{ hashFiles('**/go.sum') }}
mod-restore-key:
description: "A prefix of `mod-key` to use to restore a stale cache if no cache hit occurred for `mod-key`"
required: false
default: ${{ github.job }}-mod-
build-key:
description: "An explicit key for restoring and saving the build cache"
required: false
default: ${{ github.job }}-${{ runner.os }}-${GO_VERSION}-${{ github.run_id }}-${{ github.run_attempt }}
build-restore-key:
description: "A prefix of `build-key` to use to restore a stale cache if no cache hit occurred for `build-key`"
required: false
default: ${{ github.job }}-${{ runner.os }}-${GO_VERSION}-
```