Skip to content

Commit

Permalink
Use global env variable in GH workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ccremer committed May 17, 2020
1 parent 61eb110 commit 52d9b4e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,32 @@ on:
pull_request:
types: [opened, reopened]

env:
GO_VERSION: "^1.14.3"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-go@v2-beta
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v1
with:
path: /home/runner/go/pkg/mod
key: go-mod-build
- uses: goreleaser/goreleaser-action@v1
with:
args: release --snapshot --skip-sign

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-go@v2
with:
go-version: '^1.14.2'
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v1
with:
path: /home/runner/go/pkg/mod
Expand All @@ -30,6 +48,3 @@ jobs:
prefix: ${{ github.event.repository.name }}
coverageLocations:
"${{github.workspace}}/c.out:gocov"
- uses: goreleaser/goreleaser-action@v1
with:
args: release --snapshot --skip-sign
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ on:
tags:
- "*"

env:
GO_VERSION: "^1.14.3"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-go@v2-beta
- uses: actions/setup-go@v2
with:
go-version: '^1.14.2'
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v1
with:
path: /home/runner/go/pkg/mod
Expand Down

0 comments on commit 52d9b4e

Please sign in to comment.