Skip to content

Commit

Permalink
chore: add README
Browse files Browse the repository at this point in the history
  • Loading branch information
ArielSantos01 committed Dec 23, 2024
1 parent 44342ff commit 499dc38
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Action Golang with cache

Composite GitHub Action combining a perfect pairing of [useblacksmith/setup-go](https://github.com/useblacksmith/setup-go) with [useblacksmith/cache](https://github.com/useblacksmith/cache) for caching of both Golang module and build caches.

## Configuration

```yaml
- name: Setup Golang
uses: Drafteame/go-cache-action@main
with:
go-version: 1.22.7 # go version
go-version-file: go.mod # Path to go.mod file, will determine Golang version.
cache-key-suffix: suffix # Optional cache key suffix


```
### Outputs

| Output | Description |
|------------|---------------------------------------------------|
| **build-cache-path** | Golang build cache path. |
| **module-cache-path** | Golang module cache path. |
| **cache-key** | Cache key holding Golang build and module cache paths. |

## Usage

```yaml
steps:
- name: Setup Golang with cache
uses: Drafteame/go-cache-action@main
with:
go-version: 1.22.7

```

or better yet, use `go-version-file` for version selection:

```yaml
steps:
- name: Setup Golang with cache
uses: Drafteame/go-cache-action@main
with:
go-version-file: go.mod
```
Action correctly saves/restores **build** and **module** cache paths for Linux, macOS _and_ Windows runners.

0 comments on commit 499dc38

Please sign in to comment.