Skip to content

Commit

Permalink
ci: use setup-go for Windows and hardcode GO_VERSION (#1183)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
pendo324 authored Nov 15, 2024
1 parent f85dc03 commit c9a0042
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 12 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-and-test-msi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- cron: '0 9 * * *'
env:
GO111MODULE: on
GO_VERSION: '1.22.9'

permissions:
# This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on.
Expand Down Expand Up @@ -67,6 +68,10 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install awscli
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ needs.get-tag-name.outputs.tag }}
Expand Down Expand Up @@ -170,6 +175,10 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install awscli
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ needs.get-tag-name.outputs.tag }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build-pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ permissions:
# This is required for actions/checkout
contents: read

env:
GO_VERSION: '1.22.9'

jobs:
build:
runs-on:
Expand All @@ -45,7 +48,7 @@ jobs:
submodules: true
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Build for macOS ${{ inputs.version }} (${{ inputs.output_arch }})
run: |
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ permissions:

env:
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
GO_VERSION: '1.22.8'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -73,7 +74,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
- run: make gen-code
- run: git diff --exit-code
Expand All @@ -91,9 +92,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
# Since this repository is not meant to be used as a library,
# we don't need to test the latest 2 major releases like Go does: https://go.dev/doc/devel/release#policy.
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
- run: make test-unit
# It's recommended to run golangci-lint in a job separate from other jobs (go test, etc) because different jobs run in parallel.
Expand All @@ -104,7 +103,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
- name: set GOOS env to windows
run: |
Expand Down Expand Up @@ -144,7 +143,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
# TODO: Use `go mod tidy --check` after https://github.com/golang/go/issues/27005 is fixed.
- run: go mod tidy
Expand All @@ -155,7 +154,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
- run: make check-licenses
macos-e2e-tests:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/e2e-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ permissions:
# This is required for actions/checkout
contents: read

env:
GO_VERSION: '1.22.9'

jobs:
test:
runs-on:
Expand All @@ -41,7 +44,7 @@ jobs:
submodules: recursive
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Set output variables
id: vars
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/e2e-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ permissions:
# This is required for actions/checkout
contents: read

env:
GO_VERSION: '1.22.9'

jobs:
test:
timeout-minutes: 180
Expand Down Expand Up @@ -66,6 +69,10 @@ jobs:
Remove-Item C:\Users\Administrator\AppData\Local\.finch -Recurse -ErrorAction Ignore
make clean
cd deps/finch-core && make clean
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Build project
run: |
git status
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test-pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ permissions:
# This is required for actions/checkout
contents: read

env:
GO_VERSION: '1.22.9'

jobs:
test:
runs-on:
Expand All @@ -48,7 +51,7 @@ jobs:
submodules: true
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Clean up previous files
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/upload-build-to-S3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
workflow_dispatch:
env:
GO111MODULE: on
GO_VERSION: '1.22.9'

permissions:
# This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on.
Expand All @@ -23,7 +24,7 @@ jobs:
submodules: true
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Make macos aarch64 build
run: |
Expand Down Expand Up @@ -52,7 +53,7 @@ jobs:
submodules: true
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Make macos x86_64 build
run: |
Expand Down

0 comments on commit c9a0042

Please sign in to comment.