Skip to content

Commit

Permalink
Use actions/setup-go@v5
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Jan 19, 2024
1 parent 94ee9ec commit 602882b
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 45 deletions.
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 }}
go-version-file: go.mod
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
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
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
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
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/[email protected] -l
}

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

json_print_latest_releases() {
Expand Down

0 comments on commit 602882b

Please sign in to comment.