Skip to content

Commit

Permalink
Use go.mod to define the Go version in the actions
Browse files Browse the repository at this point in the history
This commit changes all GitHub Actions to use the go.mod file for specifying the Go version instead of pinning the version directly. This reduces the burden of maintaining the Go version across multiple workflows.
  • Loading branch information
camilamacedo86 committed Nov 24, 2024
1 parent 8911e2f commit 4cffbd3
Show file tree
Hide file tree
Showing 29 changed files with 33 additions and 33 deletions.
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.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: Clone the code
uses: actions/checkout@v4
- name: Run linter
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
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/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
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
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

0 comments on commit 4cffbd3

Please sign in to comment.