Skip to content

Commit a91a101

Browse files
committed
update ci
Signed-off-by: kerthcet <kerthcet@gmail.com>
1 parent c9fd7c7 commit a91a101

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

.golangci.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
run:
2+
timeout: 5m
3+
allow-parallel-runners: true
4+
5+
issues:
6+
# don't skip warning about doc comments
7+
# don't exclude the default set of lint
8+
exclude-use-default: false
9+
# restore some of the defaults
10+
# (fill in the rest as needed)
11+
exclude-rules:
12+
- path: "api/*"
13+
linters:
14+
- lll
15+
- path: "pkg/*"
16+
linters:
17+
- dupl
18+
- lll
19+
- path: "test/*"
20+
linters:
21+
- dupl
22+
- lll
23+
linters:
24+
disable-all: true
25+
enable:
26+
- dupl
27+
- errcheck
28+
- exportloopref
29+
- goconst
30+
- gofmt
31+
- goimports
32+
- gosimple
33+
- govet
34+
- ineffassign
35+
- misspell
36+
- nakedret
37+
- prealloc
38+
- staticcheck
39+
- typecheck
40+
- unconvert
41+
- unparam
42+
- unused

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ SHELL = /usr/bin/env bash -o pipefail
3939
.PHONY: all
4040
all: build
4141

42+
LOCALBIN ?= $(shell pwd)/bin
43+
$(LOCALBIN):
44+
mkdir -p $(LOCALBIN)
45+
46+
GINKGO = $(shell pwd)/bin/ginkgo
47+
GINKGO_VERSION ?= $(shell go list -m -f '{{.Version}}' github.com/onsi/ginkgo/v2)
48+
.PHONY: ginkgo
49+
ginkgo: ## Download ginkgo locally if necessary.
50+
test -s $(LOCALBIN)/ginkgo || \
51+
GOBIN=$(LOCALBIN) go install github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION)
52+
4253
##@ General
4354

4455
# The help target prints out all targets with their descriptions organized
@@ -84,6 +95,16 @@ gotestsum: ## Download gotestsum locally if necessary.
8495
test: fmt vet envtest gotestsum ## Run tests.
8596
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml -- ./api/... ./pkg/... -coverprofile $(ARTIFACTS)/cover.out
8697

98+
.PHONY: test-integration
99+
test-integration: fmt vet envtest ginkgo ## Run integration tests.
100+
@echo "skip integration test"
101+
# KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" \
102+
# $(GINKGO) --junit-report=junit.xml --output-dir=$(ARTIFACTS) -v $(INTEGRATION_TARGET)
103+
104+
test-e2e: fmt vet envtest ginkgo
105+
@echo "skip e2e test"
106+
# E2E_KIND_NODE_VERSION=$(E2E_KIND_NODE_VERSION) KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) KIND=$(KIND) KUBECTL=$(KUBECTL) KUSTOMIZE=$(KUSTOMIZE) GINKGO=$(GINKGO) USE_EXISTING_CLUSTER=$(USE_EXISTING_CLUSTER) IMAGE_TAG=$(IMG) ENVTEST_LWS_VERSION=$(ENVTEST_LWS_VERSION) ./hack/e2e-test.sh
107+
87108
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
88109
GOLANGCI_LINT_VERSION ?= v1.54.2
89110
golangci-lint:

0 commit comments

Comments
 (0)