Skip to content

Commit c9a0042

Browse files
authored
ci: use setup-go for Windows and hardcode GO_VERSION (runfinch#1183)
* ci: use setup-go for Windows and hardcode GO_VERSION Signed-off-by: Justin Alvarez <[email protected]> * disable cacheing Signed-off-by: Justin Alvarez <[email protected]> --------- Signed-off-by: Justin Alvarez <[email protected]>
1 parent f85dc03 commit c9a0042

File tree

7 files changed

+37
-12
lines changed

7 files changed

+37
-12
lines changed

.github/workflows/build-and-test-msi.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- cron: '0 9 * * *'
1717
env:
1818
GO111MODULE: on
19+
GO_VERSION: '1.22.9'
1920

2021
permissions:
2122
# This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on.
@@ -67,6 +68,10 @@ jobs:
6768
run: |
6869
python -m pip install --upgrade pip
6970
pip install awscli
71+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
72+
with:
73+
go-version: ${{ env.GO_VERSION }}
74+
cache: false
7075
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7176
with:
7277
ref: ${{ needs.get-tag-name.outputs.tag }}
@@ -170,6 +175,10 @@ jobs:
170175
run: |
171176
python -m pip install --upgrade pip
172177
pip install awscli
178+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
179+
with:
180+
go-version: ${{ env.GO_VERSION }}
181+
cache: false
173182
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
174183
with:
175184
ref: ${{ needs.get-tag-name.outputs.tag }}

.github/workflows/build-pkg.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ permissions:
2525
# This is required for actions/checkout
2626
contents: read
2727

28+
env:
29+
GO_VERSION: '1.22.9'
30+
2831
jobs:
2932
build:
3033
runs-on:
@@ -45,7 +48,7 @@ jobs:
4548
submodules: true
4649
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
4750
with:
48-
go-version-file: go.mod
51+
go-version: ${{ env.GO_VERSION }}
4952
cache: false
5053
- name: Build for macOS ${{ inputs.version }} (${{ inputs.output_arch }})
5154
run: |

.github/workflows/ci.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ permissions:
3939

4040
env:
4141
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
42+
GO_VERSION: '1.22.8'
4243

4344
concurrency:
4445
group: ${{ github.workflow }}-${{ github.ref }}
@@ -73,7 +74,7 @@ jobs:
7374
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7475
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
7576
with:
76-
go-version-file: go.mod
77+
go-version: ${{ env.GO_VERSION }}
7778
cache: false
7879
- run: make gen-code
7980
- run: git diff --exit-code
@@ -91,9 +92,7 @@ jobs:
9192
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9293
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
9394
with:
94-
# Since this repository is not meant to be used as a library,
95-
# we don't need to test the latest 2 major releases like Go does: https://go.dev/doc/devel/release#policy.
96-
go-version-file: go.mod
95+
go-version: ${{ env.GO_VERSION }}
9796
cache: false
9897
- run: make test-unit
9998
# It's recommended to run golangci-lint in a job separate from other jobs (go test, etc) because different jobs run in parallel.
@@ -104,7 +103,7 @@ jobs:
104103
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
105104
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
106105
with:
107-
go-version-file: go.mod
106+
go-version: ${{ env.GO_VERSION }}
108107
cache: false
109108
- name: set GOOS env to windows
110109
run: |
@@ -144,7 +143,7 @@ jobs:
144143
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
145144
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
146145
with:
147-
go-version-file: go.mod
146+
go-version: ${{ env.GO_VERSION }}
148147
cache: false
149148
# TODO: Use `go mod tidy --check` after https://github.com/golang/go/issues/27005 is fixed.
150149
- run: go mod tidy
@@ -155,7 +154,7 @@ jobs:
155154
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
156155
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
157156
with:
158-
go-version-file: go.mod
157+
go-version: ${{ env.GO_VERSION }}
159158
cache: false
160159
- run: make check-licenses
161160
macos-e2e-tests:

.github/workflows/e2e-macos.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ permissions:
2222
# This is required for actions/checkout
2323
contents: read
2424

25+
env:
26+
GO_VERSION: '1.22.9'
27+
2528
jobs:
2629
test:
2730
runs-on:
@@ -41,7 +44,7 @@ jobs:
4144
submodules: recursive
4245
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
4346
with:
44-
go-version-file: go.mod
47+
go-version: ${{ env.GO_VERSION }}
4548
cache: false
4649
- name: Set output variables
4750
id: vars

.github/workflows/e2e-windows.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ permissions:
1919
# This is required for actions/checkout
2020
contents: read
2121

22+
env:
23+
GO_VERSION: '1.22.9'
24+
2225
jobs:
2326
test:
2427
timeout-minutes: 180
@@ -66,6 +69,10 @@ jobs:
6669
Remove-Item C:\Users\Administrator\AppData\Local\.finch -Recurse -ErrorAction Ignore
6770
make clean
6871
cd deps/finch-core && make clean
72+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
73+
with:
74+
go-version: ${{ env.GO_VERSION }}
75+
cache: false
6976
- name: Build project
7077
run: |
7178
git status

.github/workflows/test-pkg.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ permissions:
2525
# This is required for actions/checkout
2626
contents: read
2727

28+
env:
29+
GO_VERSION: '1.22.9'
30+
2831
jobs:
2932
test:
3033
runs-on:
@@ -48,7 +51,7 @@ jobs:
4851
submodules: true
4952
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
5053
with:
51-
go-version-file: go.mod
54+
go-version: ${{ env.GO_VERSION }}
5255
cache: false
5356
- name: Clean up previous files
5457
run: |

.github/workflows/upload-build-to-S3.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
workflow_dispatch:
55
env:
66
GO111MODULE: on
7+
GO_VERSION: '1.22.9'
78

89
permissions:
910
# This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on.
@@ -23,7 +24,7 @@ jobs:
2324
submodules: true
2425
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
2526
with:
26-
go-version-file: go.mod
27+
go-version: ${{ env.GO_VERSION }}
2728
cache: false
2829
- name: Make macos aarch64 build
2930
run: |
@@ -52,7 +53,7 @@ jobs:
5253
submodules: true
5354
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
5455
with:
55-
go-version-file: go.mod
56+
go-version: ${{ env.GO_VERSION }}
5657
cache: false
5758
- name: Make macos x86_64 build
5859
run: |

0 commit comments

Comments
 (0)