Skip to content

gacts/setup-go-with-cache

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Logo

Setup Go environment with a Cache

Release version Build Status License

Composite GitHub Action which combines the perfect pairing of actions/setup-go with actions/cache for the caching of both the Golang module and build caches (the original action idea was taken here).

Reducing all these workflow steps:

steps:
  - name: Setup Golang
    uses: actions/setup-go@v3
    with:
      go-version: 1.19

  - name: Setup Golang caches
    uses: actions/cache@v3
    with:
      path: |
        ~/.cache/go-build
        ~/go/pkg/mod
      key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
      restore-keys: |
        ${{ runner.os }}-golang-

Down to this:

steps:
  - uses: gacts/setup-go-with-cache@v1
    with: {go-version: 1.19}

Or using go-version-file for version selection:

steps:
  - uses: gacts/setup-go-with-cache@v1
    with: {go-version-file: go.mod}

Tip: Use Dependabot to maintain your gacts/setup-go-with-cache version updated in your GitHub workflows.

Support

Issues Issues

If you find any action errors - please, make an issue in the current repository.

License

This is open-sourced software licensed under the MIT License.