Skip to content

Commit

Permalink
Merge pull request #25089 from hashicorp/update-setup-go-config
Browse files Browse the repository at this point in the history
Updates `actions/setup-go` to use `go-version-file`
  • Loading branch information
gdavison committed Jun 6, 2022
2 parents 54f5ba5 + 21bd679 commit 1c2747f
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 63 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/acctest-terraform-lint.yml
Expand Up @@ -18,11 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
Expand All @@ -41,11 +39,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/changelog.yml
Expand Up @@ -59,11 +59,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/dependencies.yml
Expand Up @@ -64,11 +64,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- name: go mod
run: |
echo "==> Checking source code with go mod tidy..."
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/documentation.yml
Expand Up @@ -39,11 +39,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/examples.yml
Expand Up @@ -29,11 +29,9 @@ jobs:
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- name: go build
run: go build -o terraform-plugin-dir/terraform-provider-aws_v99.99.99_x5 .
- name: override plugin
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/skaff.yml
Expand Up @@ -18,11 +18,9 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
# See also: https://github.com/actions/setup-go/issues/54
- name: go env
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/snapshot.yml
Expand Up @@ -10,11 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
Expand Down
36 changes: 9 additions & 27 deletions .github/workflows/terraform_provider.yml
Expand Up @@ -34,11 +34,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
id: cache-go-pkg-mod
Expand All @@ -62,12 +60,10 @@ jobs:
with:
path: terraform-plugin-dir
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }}
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
# See also: https://github.com/actions/setup-go/issues/54
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
name: go env
Expand Down Expand Up @@ -128,11 +124,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
# See also: https://github.com/actions/setup-go/issues/54
- name: go env
run: |
Expand All @@ -159,11 +153,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
# See also: https://github.com/actions/setup-go/issues/54
- name: go env
run: |
Expand Down Expand Up @@ -195,11 +187,9 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
# See also: https://github.com/actions/setup-go/issues/54
- name: go env
run: |
Expand Down Expand Up @@ -281,11 +271,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
# See also: https://github.com/actions/setup-go/issues/54
- name: go env
run: |
Expand All @@ -311,11 +299,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
# See also: https://github.com/actions/setup-go/issues/54
- name: go env
run: |
Expand All @@ -340,11 +326,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
Expand Down Expand Up @@ -376,11 +360,9 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
# See also: https://github.com/actions/setup-go/issues/54
- name: go env
run: |
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/website.yml
Expand Up @@ -74,11 +74,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
Expand All @@ -91,11 +89,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
Expand All @@ -108,11 +104,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/workflow-lint.yml
Expand Up @@ -12,11 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See also: https://github.com/actions/setup-go/pull/62
- run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: .go-version
- name: Install actionlint
run: cd tools && go install github.com/rhysd/actionlint/cmd/actionlint
- name: Run actionlint on workflow files
Expand Down

0 comments on commit 1c2747f

Please sign in to comment.