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

Use actions/setup-go@v5 in github actions #3914

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 3 additions & 2 deletions .github/workflows/autopilot-branch-to-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ jobs:
run: .github/workflows/prepare-build-env.sh

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was GO_VERSION ever required for something else than this? If not, it could be removed from .github/workflows/prepare-build-env.sh.

go-version-file: go.mod
kke marked this conversation as resolved.
Show resolved Hide resolved
cache: false

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/check-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ jobs:
run: .github/workflows/prepare-build-env.sh

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: false

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
Expand Down
38 changes: 12 additions & 26 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,27 +165,10 @@ jobs:
run: .github/workflows/prepare-build-env.sh

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Cache GOCACHE
uses: actions/cache@v4
with:
key: unittests-k0s-windows-amd64-gocache-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
unittests-k0s-windows-amd64-gocache-${{ github.ref_name }}-
path: |
~\AppData\Local\go-build

- name: Cache GOMODCACHE
uses: actions/cache@v4
with:
key: unittests-k0s-windows-amd64-gomodcache-${{ hashFiles('go.sum') }}
restore-keys: |
build-k0s-windows-amd64-gomodcache-${{ hashFiles('go.sum') }}
path: |
~\go\pkg\mod
go-version-file: go.mod
cache: false

- name: Run unit tests
env:
Expand Down Expand Up @@ -222,9 +205,10 @@ jobs:
run: .github/workflows/prepare-docker-ipv6.sh

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
kke marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: false

- name: Download compiled executable
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -285,9 +269,10 @@ jobs:
run: .github/workflows/prepare-build-env.sh

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
kke marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: false

- name: Download compiled executable
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -346,9 +331,10 @@ jobs:
run: .github/workflows/prepare-build-env.sh

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
kke marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: false

- name: Cache embedded binaries
uses: actions/cache@v4
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,12 @@ jobs:
with:
fetch-depth: 0

- name: Go caches
uses: actions/cache@v4
- name: Builder cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-lint-go-caches-${{ hashFiles('go.sum') }}
path: |
build/cache
~/go/pkg/mod
~/.cache/go-build
~/.cache/golangci-lint

- name: Check go.mod/go.sum to be consistent
run: make --always-make go.sum && git diff --exit-code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAGS=$(gh release list -L 1000 -R "$GITHUB_REPOSITORY" | grep "+k0s." | grep -v Draft | cut -f 1 | k0s_sort)
TAGS=$(gh release list -L 1000 -R "$GITHUB_REPOSITORY" | grep "+k0s." | grep -v Draft | cut -f 1 | ./k0s_sort)
LATEST=$(echo "${TAGS}" | tail -1)
STABLE=$(echo "${TAGS}" | grep -v -- "-" | tail -1)
mike alias -u head main
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ jobs:
VERSION: ${{ needs.release.outputs.tag_name }}

- name: Set up Go for smoke tests
uses: actions/setup-go@v3
uses: actions/setup-go@v5
kke marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: false

- name: Run basic smoke test
run: make check-basic
Expand Down Expand Up @@ -254,9 +255,10 @@ jobs:
/k0s/k0s --output-file /k0s/k0s.sig
- name: Set up Go for smoke tests
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: false

- name: Run basic smoke test
run: make check-basic
Expand Down Expand Up @@ -362,9 +364,10 @@ jobs:
/k0s/k0s --output-file /k0s/k0s.sig
- name: Set up Go for smoke tests
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: false

- name: Run basic smoke test
run: make check-basic
Expand Down Expand Up @@ -581,9 +584,10 @@ jobs:
run: .github/workflows/prepare-build-env.sh

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: false

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
Expand Down
6 changes: 5 additions & 1 deletion hack/tools/gen-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ list_k0s_releases() {
VERSION_PREFIX="v$1" gh api -X GET /repos/k0sproject/k0s/releases -F per_page=100 --paginate --jq "$query"
}

k0s_sort() {
go run github.com/k0sproject/version/cmd/k0s_sort@v0.6.0 -l
}

latest_release() {
list_k0s_releases "$1" | k0s_sort -l
list_k0s_releases "$1" | k0s_sort
}

json_print_latest_releases() {
Expand Down
Loading