cache icon indicating copy to clipboard operation
cache copied to clipboard

A better golang cache recipe for ASDF users

Open airtonix opened this issue 3 years ago • 1 comments

name: Setup Golang

description: provisions tooling and installs dependancies

runs:
  using: "composite"

  steps:
    - name: Get GO cache directory path
      id: go-cache-dir-path
      run: echo "::set-output name=dir::$(go env GOCACHE)"
      shell: bash

    - uses: actions/cache@v3
      id: go-cache
      with:
        path: ${{ steps.go-cache-dir-path.outputs.dir }}
        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
        restore-keys: |
          ${{ runner.os }}-go-

    - name: Install go deps
      shell: bash
      run: go mod download
      if: steps.go-cache.outputs.cache-hit != 'true'

airtonix avatar Jun 26 '22 12:06 airtonix

@airtonix do you want to create a PR by updating this in the readme docs so that we can have more eyes on this?

kotewar avatar Jul 11 '22 05:07 kotewar

Closed due to no reply. Feel free to reopen this issue if you feel this needs to be addressed. I tried a sample workflow with normal golang code but didn't get any success with it, requesting you to please share a sample workflow where this recipe works across OSes. Thanks!

kotewar avatar Oct 19 '22 07:10 kotewar