diff --git a/.dependencies.yaml b/.dependencies.yaml new file mode 100644 index 000000000..1a23636c9 --- /dev/null +++ b/.dependencies.yaml @@ -0,0 +1,49 @@ +dependencies: + +- name: "zeitgeist" + version: 0.5.3 + refPaths: + - path: hack/verify-dependencies-version.sh + match: sigs.k8s.io/zeitgeist@v + +- name: "golang" + version: 1.22.3 + refPaths: + - path: go.mod + match: "go " + - path: .github/workflows/golangci-lint.yaml + match: "GO_VERSION: " + - path: .github/workflows/releases.yaml + match: "GO_VERSION: " + - path: .github/workflows/test.yaml + match: "GO_VERSION: " + - path: hack/requirements.sh + match: "GO_VERSION=" + +- name: "golangci" + version: 1.58.2 + refPaths: + - path: .github/workflows/golangci-lint.yaml + match: "GOLANGCI_VERSION: " + - path: hack/update-go-lint.sh + match: "golangci-lint@v" + - path: hack/verify-go-lint.sh + match: "golangci-lint@v" + +- name: "kind" + version: 0.23.0 + refPaths: + - path: hack/requirements.sh + match: "KIND_VERSION=" + - path: pkg/consts/consts.go + match: "KindVersion" + +- name: "kubernetes" + version: 1.30.0 + refPaths: + - path: supported_releases.txt + match: "" + - path: pkg/consts/consts.go + match: "KubeVersion" + - path: hack/requirements.sh + match: "KUBE_VERSION=" diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index f5d86f4e9..06451568d 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -4,6 +4,11 @@ on: types: [opened, edited, synchronize, reopened] branches: - main + +env: + GO_VERSION: "1.22.3" + GOLANGCI_VERSION: "1.58.2" + jobs: golangci: name: lint @@ -11,10 +16,10 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: ${{ env.GO_VERSION }} - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.58.2 + version: v${{ env.GOLANGCI_VERSION }} args: --timeout=30m --config=.golangci.yaml diff --git a/.github/workflows/releases.yaml b/.github/workflows/releases.yaml index af92cdc93..56cdde50a 100644 --- a/.github/workflows/releases.yaml +++ b/.github/workflows/releases.yaml @@ -8,6 +8,7 @@ env: PUSH: 'true' PRE_RELEASE: GA GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GO_VERSION: "1.22.3" jobs: releases: @@ -18,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: ${{ env.GO_VERSION }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 68fb73390..d310b5ef2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,6 +23,7 @@ on: env: DOCKER_CLI_EXPERIMENTAL: "enabled" CGO_ENABLED: "0" + GO_VERSION: "1.22.3" # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency concurrency: @@ -43,7 +44,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: ${{ env.GO_VERSION }} - name: Test shell: bash @@ -82,7 +83,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: ${{ env.GO_VERSION }} - name: Test e2e default shell: bash @@ -108,7 +109,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: ${{ env.GO_VERSION }} - name: Install Kind shell: bash @@ -168,7 +169,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: ${{ env.GO_VERSION }} - name: Install CoreUtils for MacOS if: ${{ startsWith(matrix.os, 'macos-') }} diff --git a/hack/requirements.sh b/hack/requirements.sh index 3c26d74a3..e46129e77 100755 --- a/hack/requirements.sh +++ b/hack/requirements.sh @@ -25,7 +25,7 @@ export PATH="${LOCAL_BIN_DIR}:${PATH}" KIND_VERSION=0.23.0 -KUBE_VERSION=1.29.0 +KUBE_VERSION=1.30.0 # TODO: Stay at 0.9 in figuring out the Attestations of buildx. # https://github.com/docker/buildx/pull/1412 diff --git a/hack/verify-all.sh b/hack/verify-all.sh index bf774b34d..76c459806 100755 --- a/hack/verify-all.sh +++ b/hack/verify-all.sh @@ -98,6 +98,11 @@ if [[ "${VERIFY_STAGES:-true}" == "true" ]]; then "${ROOT_DIR}"/hack/verify-stages.sh || failed+=(stages) fi +if [[ "${VERIFY_DEPENDENCIES_VERSION:-true}" == "true" ]]; then + echo "[*] Verifying dependencies version..." + "${ROOT_DIR}"/hack/verify-dependencies-version.sh || failed+=(dependencies-version) +fi + # exit based on verify scripts if [[ "${#failed[@]}" != 0 ]]; then echo "Verify failed for: ${failed[*]}" diff --git a/hack/verify-dependencies-version.sh b/hack/verify-dependencies-version.sh new file mode 100755 index 000000000..4c7510ab9 --- /dev/null +++ b/hack/verify-dependencies-version.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# Copyright 2024 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +DIR="$(dirname "${BASH_SOURCE[0]}")" + +ROOT_DIR="$(realpath "${DIR}/..")" + +go run sigs.k8s.io/zeitgeist@v0.5.3 validate \ + --local-only \ + --base-path "${ROOT_DIR}" \ + --config "${ROOT_DIR}"/.dependencies.yaml