-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yaml
34 lines (34 loc) · 1.13 KB
/
action.yaml
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
31
32
33
34
---
name: "Setup Go environment"
description: "Setup a Go environment and add it to the PATH (with caching!)"
inputs:
go-version:
description: "The Go version to download (if necessary) and use. Supports semver spec and ranges."
default: "1.23.6"
go-version-file:
description: "Path to the go.mod or go.work file."
cache-dependency-path:
description: "Used to specify the path to a dependency file - go.sum"
default: "**/go.sum"
download:
description: "Whether or not to run go mod download as part of setup"
default: "true"
required: false
working_directory:
description: "The directory with the root of the project"
default: "."
required: "false"
runs:
using: "composite"
steps:
- uses: "actions/setup-go@v5"
with:
go-version: "${{ inputs.go-version }}"
go-version-file: "${{ inputs.go-version-file }}"
cache-dependency-path: "${{ inputs.cache-dependency-path }}"
cache: "true"
- name: "Run Go Mod Download"
if: "inputs.download == 'true'"
working-directory: "${{ inputs.working_directory }}"
shell: "bash"
run: "go mod download"