Change definition of the cache input and rewrite README

This commit is contained in:
Ivan Zosimov 2022-04-21 15:58:14 +02:00
parent 3a3f8d0d3c
commit 5ee8b21df4
2 changed files with 5 additions and 5 deletions

View File

@ -93,13 +93,13 @@ steps:
- run: go run hello.go - run: go run hello.go
``` ```
## Caching packages dependencies: ## Caching dependency files and build outputs:
The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under the hood for caching dependencies but requires less configuration settings.The `cache` input is optional, and caching is turned off by default. The action has a built-in functionality for caching and restoring go modules and build outputs. It uses [actions/cache](https://github.com/actions/cache) under the hood but requires less configuration settings.The `cache` input is optional, and caching is turned off by default.
The action defaults to search for the dependency file - go.sum in the repository root, and uses its hash as a part of the cache key. Use `cache-dependency-path` input for cases when multiple dependency files are used, or they are located in different subdirectories. The action defaults to search for the dependency file - go.sum in the repository root, and uses its hash as a part of the cache key. Use `cache-dependency-path` input for cases when multiple dependency files are used, or they are located in different subdirectories.
**Caching packages dependencies without specifying dependency file path** **Caching without specifying dependency file path**
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -111,7 +111,7 @@ steps:
- run: go run hello.go - run: go run hello.go
``` ```
**Caching packages dependencies in monorepos** **Caching in monorepos**
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -11,7 +11,7 @@ inputs:
description: Used to pull node distributions from go-versions. Since there's a default, this is typically not supplied by the user. description: Used to pull node distributions from go-versions. Since there's a default, this is typically not supplied by the user.
default: ${{ github.token }} default: ${{ github.token }}
cache: cache:
description: Used to specify whether go-modules caching is needed. Set to true, if you'd like to enable caching. description: Used to specify whether caching is needed. Set to true, if you'd like to enable caching.
default: false default: false
cache-dependency-path: cache-dependency-path:
description: 'Used to specify the path to a dependency file - go.sum' description: 'Used to specify the path to a dependency file - go.sum'