Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ (go/v4): Update actions to use go.mod for Go version management #4385

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.22"
go-version-file: go.mod
- name: Execute go-apidiff
uses: joelanford/go-apidiff@v0.8.2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/external-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.3'
go-version-file: docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod

- name: Build Sample External Plugin
working-directory: docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/legacy-webhook-path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.3'
go-version-file: go.mod
- name: Run make test-legacy
run: make test-legacy

2 changes: 1 addition & 1 deletion .github/workflows/lint-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
- name: Clone the code
uses: actions/checkout@v4
go-version-file: go.mod
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod
- name: Clean dist directory
run: rm -rf dist || true
- name: Install Syft to generate SBOMs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-devcontainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go 1.22.x
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
go-version-file: go.mod

- name: Setup NodeJS 20.x
uses: actions/setup-node@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-e2e-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-e2e-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-helm-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.22"
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.3'
go-version-file: go.mod
- name: Remove pre-installed kustomize
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
- name: Remove pre-installed kustomize
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version-file: go.mod
- name: Generate the coverage output
run: make test-coverage
- name: Send the coverage output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Run linter
uses: golangci/golangci-lint-action@v6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Running Tests
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Run linter
uses: golangci/golangci-lint-action@v6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Running Tests
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Run linter
uses: golangci/golangci-lint-action@v6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Running Tests
run: |
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module sigs.k8s.io/kubebuilder/v4

go 1.22.0

toolchain go1.22.3
go 1.22.3

require (
github.com/gobuffalo/flect v1.0.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Run linter
uses: golangci/golangci-lint-action@v6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Running Tests
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Run linter
uses: golangci/golangci-lint-action@v6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Running Tests
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Run linter
uses: golangci/golangci-lint-action@v6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Running Tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Run linter
uses: golangci/golangci-lint-action@v6
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/.github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Install the latest version of kind
run: |
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version-file: go.mod

- name: Running Tests
run: |
Expand Down