Skip to content

Commit af87d1b

Browse files
authored
Improve Go workflows (#371)
1 parent 93dc120 commit af87d1b

File tree

6 files changed

+10
-40
lines changed

6 files changed

+10
-40
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,8 @@ jobs:
2323
- name: Set up Go
2424
uses: actions/setup-go@v3
2525
with:
26-
go-version: 1.19
27-
- name: Restore Cache
28-
uses: actions/cache@v3
29-
with:
30-
path: |-
31-
~/go/pkg/mod
32-
~/.cache/go-build
33-
~/Library/Caches/go-build
34-
%LocalAppData%\go-build
35-
key: ${{ matrix.os }}-go-${{ hashFiles('go.sum') }}
36-
restore-keys: |
37-
${{ runner.os }}-go-
26+
go-version-file: 'go.mod'
27+
cache: true
3828
- name: Run tests
3929
run: make test
4030
- name: Run build

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@v3
2626
- name: Set up Go
27-
uses: actions/setup-go@v2
27+
uses: actions/setup-go@v3
2828
with:
29-
go-version: 1.19
29+
go-version-file: 'go.mod'
3030
- name: Install TFLint
3131
run: curl -sL https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
3232
- name: Install plugin (Linux)

.github/workflows/generated_code_checks.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,7 @@ jobs:
1313
- name: Set up Go
1414
uses: actions/setup-go@v3
1515
with:
16-
go-version: 1.19
17-
- name: Restore Cache
18-
uses: actions/cache@v3
19-
with:
20-
path: |-
21-
~/go/pkg/mod
22-
~/.cache/go-build
23-
~/Library/Caches/go-build
24-
%LocalAppData%\go-build
25-
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
26-
restore-keys: |
27-
${{ runner.os }}-go-
16+
go-version-file: 'go.mod'
17+
cache: true
2818
- name: go generate and diff checks
2919
run: go generate ./... && git diff --exit-code

.github/workflows/goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v3
2121
with:
22-
go-version: 1.19
22+
go-version-file: 'go.mod'
2323
- name: goreleaser check
2424
uses: goreleaser/goreleaser-action@v3
2525
with:

.github/workflows/maintenance.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
submodules: true
1414
- uses: actions/setup-go@v3
1515
with:
16-
go-version: 1.19
16+
go-version-file: 'go.mod'
1717
- run: |
1818
go get github.com/aws/aws-sdk-go
1919
go mod tidy

.github/workflows/release.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,8 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v3
2020
with:
21-
go-version: 1.19
22-
- name: Restore Cache
23-
uses: actions/cache@v3
24-
with:
25-
path: |-
26-
~/go/pkg/mod
27-
~/.cache/go-build
28-
~/Library/Caches/go-build
29-
%LocalAppData%\go-build
30-
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
31-
restore-keys: |
32-
${{ runner.os }}-go-
21+
go-version-file: 'go.mod'
22+
cache: true
3323
- name: Run GoReleaser
3424
uses: goreleaser/goreleaser-action@v3
3525
with:

0 commit comments

Comments
 (0)