Skip to content

Commit

Permalink
update golang and controller-tools versions, use golangci-lint
Browse files Browse the repository at this point in the history
Signed-off-by: Tariq Ibrahim <[email protected]>
  • Loading branch information
tariq1890 committed Aug 28, 2024
1 parent d0f42cc commit 8ea5300
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.21
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: "1.21"
go-version: "1.23"

- uses: actions/checkout@v3

Expand All @@ -22,15 +22,13 @@ jobs:
git diff | cat
git status --porcelain=v1
test $(git status --porcelain=v1 | wc -l) -eq 0
env:
GO111MODULE: on
build:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.21' ]
go: [ '1.23' ]

steps:
- uses: actions/checkout@v3
Expand Down
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
run:
timeout: 10m

linters:
enable:
- contextcheck
- gocritic
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- misspell
- staticcheck
- unconvert

linters-settings:
goimports:
local-prefixes: github.com/mittwald/go-helm-client
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,18 @@ help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)


.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...

.PHONY: vet
vet: ## Run go vet against code.
go vet ./...
.PHONY: lint
lint: ## Run golangci-lint against code.
golangci-lint run ./...

##@ Build

.PHONY: build
build: generate fmt vet ## Build binary.
build: generate lint ## Build binary.
go build -o bin/client .

.PHONY: test
test: generate fmt vet ## Run tests.
test: generate lint ## Run tests.
go test ./... -coverprofile cover.out

.PHONY: generate
Expand All @@ -55,7 +51,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen

## Tool Versions
MOCKGEN_VERSION ?= v0.4.0
CONTROLLER_TOOLS_VERSION ?= v0.13.0
CONTROLLER_TOOLS_VERSION ?= v0.16.1

.PHONY: mockgen
mockgen: $(MOCKGEN) ## Download mockgen locally if necessary.
Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ func (c *HelmClient) RunChartTests(releaseName string) (bool, error) {
}

// Check that there are no test failures
return checkReleaseForTestFailure(rel) == false, nil
return !checkReleaseForTestFailure(rel), nil
}

// chartExists checks whether a chart is already installed
Expand Down

0 comments on commit 8ea5300

Please sign in to comment.