Skip to content

Commit ab40132

Browse files
authored
make: Update test tasks (#285)
1 parent 43e679e commit ab40132

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
go-version-file: "go.mod"
2121

2222
- name: Run tests
23-
run: make ci-test
23+
run: make test
2424

2525
- name: Run Trivy vulnerability scanner in repo mode
2626
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # 0.30.0

Makefile

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,24 @@ VERSION := v0.6.0
33
COMMIT := $(shell git rev-parse HEAD)
44
DATE := $(shell date "+%Y-%m-%dT%H:%M:%S%z")
55

6-
SRCS := $(shell find . -type f -name '*.go')
76
LDFLAGS := -ldflags="-s -w -X \"github.com/dtan4/k8sec/version.version=$(VERSION)\" -X \"github.com/dtan4/k8sec/version.commit=$(COMMIT)\" -X \"github.com/dtan4/k8sec/version.date=$(DATE)\" -extldflags -static"
8-
NOVENDOR := $(shell go list ./... | grep -v vendor)
97

10-
export GO111MODULE=on
8+
.DEFAULT_GOAL := build
119

12-
.DEFAULT_GOAL := bin/$(NAME)
13-
14-
bin/$(NAME): $(SRCS)
10+
.PHONY: build
11+
build:
1512
go build $(LDFLAGS) -o bin/$(NAME)
1613

17-
.PHONY: ci-test
18-
ci-test:
19-
go test -coverpkg=./... -coverprofile=coverage.txt -v ./...
20-
2114
.PHONY: clean
2215
clean:
2316
rm -rf bin/*
2417
rm -rf dist/*
2518
rm -rf vendor/*
2619

27-
.PHONY: fast
28-
fast:
29-
go build $(LDFLAGS) -o bin/$(NAME)
30-
3120
.PHONY: install
3221
install:
3322
go install $(LDFLAGS)
3423

3524
.PHONY: test
3625
test:
37-
go test -cover -v $(NOVENDOR)
26+
go test -cover -race ./...

0 commit comments

Comments
 (0)