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 <klehto@mirantis.com>
  • Loading branch information
kke committed Jan 17, 2024
1 parent ee32eda commit a222604
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 51 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 @@ -159,27 +159,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@v3
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@v3
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 @@ -216,9 +199,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 @@ -279,9 +263,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 @@ -340,9 +325,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@v3
Expand Down
5 changes: 1 addition & 4 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
- 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
11 changes: 4 additions & 7 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,14 @@ jobs:
cache: pip
cache-dependency-path: docs/requirements.txt

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

- name: Install dependencies
run: |
pip install --disable-pip-version-check -r docs/requirements_pip.txt
pip --version
pip install --disable-pip-version-check -r docs/requirements.txt
go install github.com/k0sproject/version/cmd/k0s_sort@v0.4.2
wget https://github.com/k0sproject/version/releases/download/v0.5.0/k0s_sort-linux-amd64
mv k0s_sort-linux-amd64 k0s_sort
chmod +x k0s_sort
- name: Generate docs
env:
Expand Down Expand Up @@ -74,7 +71,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
4 changes: 2 additions & 2 deletions hack/tools/gen-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ list_k0s_releases() {
}

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

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

json_print_latest_releases() {
Expand Down

0 comments on commit a222604

Please sign in to comment.