Compare commits

..

4 Commits

Author SHA1 Message Date
818723587f Update to use go-version (#10) 2019-08-13 16:31:11 -04:00
b98503c960 Add badge 2019-08-12 15:13:31 -04:00
e7a06beff0 Update action name 2019-08-12 14:41:23 -04:00
419ae75c25 Quoting 2019-08-01 11:05:15 -04:00
4 changed files with 22 additions and 8 deletions

View File

@ -1,8 +1,12 @@
# setup-go # setup-go
<p align="left">
<a href="https://github.com/actions/setup-go"><img alt="GitHub Actions status" src="https://github.com/actions/setup-go/workflows/Main%20workflow/badge.svg"></a>
</p>
This action sets up a go environment for use in actions by: This action sets up a go environment for use in actions by:
- optionally downloading and caching a version of go by version and adding to PATH - optionally downloading and caching a version of Go by version and adding to PATH
- registering problem matchers for error output - registering problem matchers for error output
# Usage # Usage
@ -15,7 +19,7 @@ steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- uses: actions/setup-go@v1 - uses: actions/setup-go@v1
with: with:
version: 1.9.3 // The Go version to download (if necessary) and use. go-version: '1.9.3' // The Go version to download (if necessary) and use.
- run: go run hello.go - run: go run hello.go
``` ```
@ -23,16 +27,17 @@ Matrix Testing:
```yaml ```yaml
jobs: jobs:
build: build:
runs-on: ubuntu-16.04
strategy: strategy:
matrix: matrix:
go: [ 1.8, 1.9.3, 1.10 ] go: [ '1.8', '1.9.3', '1.10' ]
name: Go ${{ matrix.go }} sample name: Go ${{ matrix.go }} sample
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- name: Setup go - name: Setup go
uses: actions/setup-go@v1 uses: actions/setup-go@v1
with: with:
version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- run: go run hello.go - run: go run hello.go
``` ```

View File

@ -1,10 +1,13 @@
name: 'Setup Go for use with actions' name: 'Setup Go environment'
description: 'Setup a Go environment and add it to the PATH, additionally providing proxy support' description: 'Setup a Go environment and add it to the PATH, additionally providing proxy support'
author: 'GitHub' author: 'GitHub'
inputs: inputs:
version: go-version:
description: 'The Go version to download (if necessary) and use. Example: 1.9.3' description: 'The Go version to download (if necessary) and use. Example: 1.9.3'
default: '1.10' default: '1.10'
# Deprecated option, do not use. Will not be supported after October 1, 2019
version:
description: 'Deprecated. Use go-version instead. Will not be supported after October 1, 2019'
runs: runs:
using: 'node12' using: 'node12'
main: 'lib/setup-go.js' main: 'lib/setup-go.js'

View File

@ -25,7 +25,10 @@ function run() {
// Version is optional. If supplied, install / use from the tool cache // Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc... // If not supplied then task is still used to setup proxy, auth, etc...
// //
const version = core.getInput('version'); let version = core.getInput('version');
if (!version) {
version = core.getInput('go-version');
}
if (version) { if (version) {
yield installer.getGo(version); yield installer.getGo(version);
} }

View File

@ -8,7 +8,10 @@ async function run() {
// Version is optional. If supplied, install / use from the tool cache // Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc... // If not supplied then task is still used to setup proxy, auth, etc...
// //
const version = core.getInput('version'); let version = core.getInput('version');
if (!version) {
version = core.getInput('go-version');
}
if (version) { if (version) {
await installer.getGo(version); await installer.getGo(version);
} }