forked from pact-im/go-pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
30 lines (30 loc) · 1019 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: 'Set up Go'
description: 'Install Go and set up cache'
inputs:
cache-key-prefix:
description: 'Cache key prefix'
required: false
default: setup-go-with-cache-${{ github.workflow }}-${{ github.job }}
runs:
using: composite
steps:
- name: Install Go
uses: actions/setup-go@v3.2.0
with:
go-version-file: .go-version
- name: Get Go cache paths
id: go-cache
shell: bash
run: |
echo "::set-output name=cache::$(go env GOCACHE)"
echo "::set-output name=modcache::$(go env GOMODCACHE)"
- name: Set up Go cache
uses: actions/cache@v3.0.2
with:
key: ${{ inputs.cache-key-prefix }}-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ inputs.cache-key-prefix }}-${{ runner.os }}-${{ github.run_id }}-
${{ inputs.cache-key-prefix }}-${{ runner.os }}-
path: |
${{ steps.go-cache.outputs.cache }}
${{ steps.go-cache.outputs.modcache }}