mirror of
https://github.com/kubereboot/kured.git
synced 2026-08-19 03:16:23 +00:00
Merge pull request #1398 from evrardjp/coherent-go-mod-and-mise-update
This commit is contained in:
@@ -9,6 +9,23 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
go-version:
|
||||
name: Check Go version consistency
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Check Go version consistency
|
||||
run: make check-go-version
|
||||
|
||||
pr-short-tests:
|
||||
name: Run short go tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.DEFAULT: all
|
||||
.PHONY: all clean install-tools dev-image release dev-manifest e2e-test minikube-publish test lint lint-go lint-sh lint-ghactions lint-docs
|
||||
.PHONY: all clean install-tools dev-image release dev-manifest e2e-test minikube-publish test lint lint-go lint-sh lint-ghactions lint-docs check-go-version
|
||||
|
||||
REGISTRY ?= ghcr.io
|
||||
IMAGE_NAME ?= kubereboot/kured
|
||||
@@ -54,6 +54,15 @@ test: lint
|
||||
|
||||
lint: lint-sh lint-ghactions lint-go
|
||||
|
||||
check-go-version:
|
||||
@echo "Checking Go version consistency"
|
||||
@go_version="$$(sed -nE 's/^go[[:space:]]+([0-9]+\.[0-9]+\.[0-9]+)[[:space:]]*$$/\1/p' go.mod)"; \
|
||||
mise_version="$$(sed -nE 's/^go[[:space:]]*=[[:space:]]*"([0-9]+\.[0-9]+\.[0-9]+)"[[:space:]]*$$/\1/p' .config/mise.toml)"; \
|
||||
if [ -z "$$go_version" ] || [ -z "$$mise_version" ] || [ "$$go_version" != "$$mise_version" ]; then \
|
||||
echo "Go version mismatch or invalid format: go.mod=$${go_version:-invalid}, .config/mise.toml=$${mise_version:-invalid}" >&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
lint-sh:
|
||||
@echo "Running shellcheck"
|
||||
find . -name '*.sh' | xargs -n1 shellcheck
|
||||
@@ -72,4 +81,5 @@ lint-docs:
|
||||
|
||||
lint-goreleaser:
|
||||
@echo "Checking goreleaser"
|
||||
goreleaser check
|
||||
goreleaser check
|
||||
|
||||
|
||||
Reference in New Issue
Block a user