Skip to content

Commit e30970d

Browse files
committed
ci: enforce golangci-lint in Makefile and CI workflows
Signed-off-by: Todd Ekenstam <[email protected]>
1 parent 1abf589 commit e30970d

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/push.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ jobs:
1616
- name: Check out code into the Go module directory
1717
uses: actions/checkout@v4
1818

19+
- name: Set up Go 1.x
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: 1.24
23+
24+
- name: Run golangci-lint
25+
uses: golangci/golangci-lint-action@v3
26+
with:
27+
version: v1.55.2
28+
args: --timeout=3m
29+
30+
- name: Test
31+
run: |
32+
make test
33+
1934
- name: Set up Docker Buildx
2035
id: buildx
2136
uses: docker/setup-buildx-action@v3
@@ -59,4 +74,3 @@ jobs:
5974
platforms: linux/amd64,linux/arm/v7,linux/arm64
6075
push: true
6176
tags: ${{ steps.docker_meta.outputs.tags }}
62-

.github/workflows/unit-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
uses: golangci/golangci-lint-action@v3
2525
with:
2626
version: v1.55.2
27-
only-new-issues: true
2827
args: --timeout=3m
2928

3029
- name: Initialize CodeQL

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ IMG ?= instance-manager:latest
3030
INSTANCEMGR_TAG ?= latest
3131

3232
.PHONY: all
33-
all: check-go test clean manager
33+
all: check-go lint test clean manager
3434

3535
# Run tests
3636
.PHONY: test
37-
test: generate fmt vet manifests
37+
test: generate fmt vet manifests lint
3838
go test ./controllers/... ./api/... -coverprofile coverage.txt
3939

4040
.PHONY: bdd
@@ -126,7 +126,7 @@ endif
126126
.PHONY: lint
127127
lint: check-go
128128
@echo "Running golangci-lint"
129-
golangci-lint run ./... || echo "Linting errors found - these will be enforced in the future"
129+
golangci-lint run ./...
130130

131131
.PHONY: clean
132132
clean:

0 commit comments

Comments
 (0)