diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh index 6d75a49..31737b2 100644 --- a/.devcontainer/post-install.sh +++ b/.devcontainer/post-install.sh @@ -47,13 +47,16 @@ echo "------------------------------------" echo "Installing development tools..." echo "------------------------------------" -# Install kind -if ! command -v kind &> /dev/null; then - echo "Installing kind..." - curl -Lo /usr/local/bin/kind "https://kind.sigs.k8s.io/dl/latest/kind-linux-${ARCH}" - chmod +x /usr/local/bin/kind - echo "kind installed successfully" +# Install kind at the version pinned in mise.toml +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +if ! command -v mise &> /dev/null; then + echo "Installing mise..." + curl -fsSL https://mise.run | MISE_VERSION="v2026.10.15" MISE_INSTALL_PATH=/usr/local/bin/mise sh fi +echo "Installing kind from mise.toml..." +mise -C "${REPO_ROOT}" install kind +ln -sf "$(mise -C "${REPO_ROOT}" which kind)" /usr/local/bin/kind +echo "kind installed successfully" # Generate kind bash completion if command -v kind &> /dev/null; then diff --git a/.github/workflows/e2e-upcloud.yml b/.github/workflows/e2e-upcloud.yml index 3217e30..3a6c580 100644 --- a/.github/workflows/e2e-upcloud.yml +++ b/.github/workflows/e2e-upcloud.yml @@ -38,14 +38,26 @@ jobs: with: go-version-file: go.mod - - name: Install the latest version of kind - run: | - curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-$(go env GOARCH) - chmod +x ./kind - sudo mv ./kind /usr/local/bin/kind + - name: Setup mise + uses: jdx/mise-action@fc42bcc7ddbf51124c30f95a877a0c5168a3bfde # v5.2.1 + with: + version: v2026.10.15 # mise + install: false + cache: false + + - name: Install kind + env: + MISE_GITHUB_TOKEN: ${{ github.token }} + run: mise install kind - name: Verify kind installation - run: kind version + run: | + want="v$(mise current kind)" + kind version + kind version | grep -qF "kind ${want} " || { + echo "ERROR: kind on PATH is not the mise.toml pin ${want}" + exit 1 + } - name: Run the real-API e2e suite env: diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index efd9cf7..e3ef580 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -27,14 +27,26 @@ jobs: with: go-version-file: go.mod - - name: Install the latest version of kind - run: | - curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-$(go env GOARCH) - chmod +x ./kind - sudo mv ./kind /usr/local/bin/kind + - name: Setup mise + uses: jdx/mise-action@fc42bcc7ddbf51124c30f95a877a0c5168a3bfde # v5.2.1 + with: + version: v2026.10.15 # mise + install: false + cache: false + + - name: Install kind + env: + MISE_GITHUB_TOKEN: ${{ github.token }} + run: mise install kind - name: Verify kind installation - run: kind version + run: | + want="v$(mise current kind)" + kind version + kind version | grep -qF "kind ${want} " || { + echo "ERROR: kind on PATH is not the mise.toml pin ${want}" + exit 1 + } - name: Running Test e2e run: | diff --git a/mise.toml b/mise.toml index 9e1603e..dd6d021 100644 --- a/mise.toml +++ b/mise.toml @@ -1,8 +1,8 @@ -# Local tool pins. CI uses the versions in go.mod and Makefile; keep these in step. +# Tool pins. CI and the devcontainer install kind from here via mise install kind; for the other tools CI uses go.mod and the Makefile, keep those in step. [tools] go = "1.26" kubebuilder = "4.15.0" -kind = "0.31" +kind = "0.31.0" kubectl = "1.36" golangci-lint = "2.12.2" diff --git a/renovate.json5 b/renovate.json5 index 4586f42..42c278e 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -49,6 +49,17 @@ "matchStrings": ["GOLANGCI_LINT_VERSION \\?= (?v[0-9.]+)"], "depNameTemplate": "golangci/golangci-lint", "datasourceTemplate": "github-releases" + }, + { + "customType": "regex", + "description": "mise binary version in CI workflows and devcontainer", + "managerFilePatterns": ["/.github/workflows/.*\\.yml$/", "/.devcontainer/post-install\\.sh$/"], + "matchStrings": [ + "version: (?[^\\s#]+)\\s*#.*mise", + "MISE_VERSION=\"(?[^\"]+)\"" + ], + "depNameTemplate": "jdx/mise", + "datasourceTemplate": "github-releases" } ] }