Skip to content

Instantly share code, notes, and snippets.

@markphelps
Last active February 4, 2021 14:27
Show Gist options
  • Save markphelps/a5de95fd1e1b4bf22ca9587d8be0cea4 to your computer and use it in GitHub Desktop.
Save markphelps/a5de95fd1e1b4bf22ca9587d8be0cea4 to your computer and use it in GitHub Desktop.

Revisions

  1. Mark Phelps revised this gist Feb 4, 2021. 1 changed file with 12 additions and 6 deletions.
    18 changes: 12 additions & 6 deletions cache-workflow.yaml
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,22 @@
    # Get values for cache paths to be used in later steps
    - id: go-cache-paths
    run: |
    echo "::set-output name=go-build::$(go env GOCACHE)"
    echo "::set-output name=go-mod::$(go env GOMODCACHE)"
    - name: Checkout
    uses: actions/checkout@v2

    # Required for speeding up go test
    # Cache go build cache, used to speedup go test
    - name: Go Build Cache
    uses: actions/cache@v2
    with:
    path: /github/home/.cache/go-build
    path: ${{ steps.go-cache-paths.outputs.go-build }}
    key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
    # Required for speeding up your go build
    - name: Go Modules Cache

    # Cache go mod cache, used to speedup builds
    - name: Go Mod Cache
    uses: actions/cache@v2
    with:
    path: ~/go/pkg/mod
    path: ${{ steps.go-cache-paths.outputs.go-mod }}
    key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
  2. Mark Phelps revised this gist Feb 4, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions cache-workflow.yaml
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,14 @@
    - name: Checkout
    uses: actions/checkout@v2

    # Required for speeding up go test
    - name: Go Build Cache
    uses: actions/cache@v2
    with:
    path: /github/home/.cache/go-build
    key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}

    # Required for speeding up your go build
    - name: Go Modules Cache
    uses: actions/cache@v2
    with:
  3. Mark Phelps revised this gist Feb 4, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cache-workflow.yaml
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    - name: Checkout
    uses: actions/checkout@v2

    - name: Cache Go Build
    - name: Go Build Cache
    uses: actions/cache@v2
    with:
    path: /github/home/.cache/go-build
  4. Mark Phelps revised this gist Feb 4, 2021. 1 changed file with 10 additions and 5 deletions.
    15 changes: 10 additions & 5 deletions cache-workflow.yaml
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,14 @@
    - name: Checkout
    uses: actions/checkout@v1
    uses: actions/checkout@v2

    - name: Restore Cache
    uses: actions/cache@preview
    id: cache
    - name: Cache Go Build
    uses: actions/cache@v2
    with:
    path: /github/home/.cache/go-build
    key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}

    - name: Go Modules Cache
    uses: actions/cache@v2
    with:
    path: ~/go/pkg/mod
    key: ${{ runner.os }}-${{ hashFiles('**/go.sum') }}
    key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
  5. Mark Phelps created this gist Nov 1, 2019.
    9 changes: 9 additions & 0 deletions cache-workflow.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    - name: Checkout
    uses: actions/checkout@v1

    - name: Restore Cache
    uses: actions/cache@preview
    id: cache
    with:
    path: ~/go/pkg/mod
    key: ${{ runner.os }}-${{ hashFiles('**/go.sum') }}