Skip to content

Commit

Permalink
Update setup-go to obtain version via go-version-file (hashicorp#…
Browse files Browse the repository at this point in the history
…1082)

* Update setup-go to obtain version via go-version-file

* Align GOPROXY usage

Remove redundant entry from ci, add missing env to benchmarks
  • Loading branch information
dbanck authored Oct 6, 2022
1 parent a955302 commit 81507c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 47 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- cron: '0 3 * * *'
workflow_dispatch:

env:
GOPROXY: https://proxy.golang.org/

jobs:
benchmarks:
runs-on: ubuntu-latest
Expand All @@ -16,20 +19,11 @@ jobs:
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Read go version
id: go-version
shell: bash
run: |
content=`cat ./.go-version`
echo "::set-output name=content::$content"
-
name: Set up Go
uses: actions/setup-go@v3
with:
# TODO: Replace with go-version-from-file when it is supported
# https://github.com/actions/setup-go/pull/62
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: ".go-version"
-
name: Go mod download
run: go mod download -x
Expand Down
30 changes: 2 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,11 @@ jobs:
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Read go version
id: go-version
run: |
content=`cat ./.go-version`
echo "::set-output name=content::$content"
-
name: Set up Go
uses: actions/setup-go@v3
env:
GOPROXY: https://proxy.golang.org/
with:
# TODO: Replace with go-version-from-file when it is supported
# https://github.com/actions/setup-go/pull/62
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: ".go-version"
-
name: Generate provider schemas
run: |
Expand Down Expand Up @@ -66,27 +56,11 @@ jobs:
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Read go version (Unix)
if: ${{ runner.os != 'Windows' }}
id: go-version-unix
run: |
content=`cat ./.go-version`
echo "::set-output name=content::$content"
-
name: Read go version (Windows)
if: ${{ runner.os == 'Windows' }}
id: go-version-win
run: |
$content = Get-Content .\.go-version -Raw
echo "::set-output name=content::$content"
-
name: Set up Go
uses: actions/setup-go@v3
with:
# TODO: Replace with go-version-from-file when it is supported
# https://github.com/actions/setup-go/pull/62
go-version: ${{ steps.go-version-unix.outputs.content || steps.go-version-win.outputs.content }}
go-version-file: ".go-version"
-
name: Go mod download
run: go mod download -x
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,11 @@ jobs:
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Read go version
id: go-version
run: |
content=`cat ./.go-version`
echo "::set-output name=content::$content"
-
name: Set up Go
uses: actions/setup-go@v3
with:
# TODO: Replace with go-version-from-file when it is supported
# https://github.com/actions/setup-go/pull/62
go-version: ${{ steps.go-version.outputs.content }}
go-version-file: ".go-version"
-
name: Generate provider schemas
run: |
Expand Down

0 comments on commit 81507c5

Please sign in to comment.