Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Jun 26, 2022
1 parent 00d616a commit 26f94c6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 405 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: DockerPublish
name: Docker Publish

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ReleasePackage
name: Release Package

on:
push:
Expand Down
38 changes: 19 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO ?= go
GOFMT ?= $(GO)fmt
go ?= go
gofmt ?= $(go)fmt
pkgs = ./...
POODLE ?= poodle
poodle ?= poodle


help: Makefile
Expand All @@ -16,17 +16,17 @@ help: Makefile
.PHONY: install_revive
install_revive:
@echo ">> ============= Install Revive ============= <<"
$(GO) get github.com/mgechev/revive
$(go) get github.com/mgechev/revive


## style: Check code style.
.PHONY: style
style:
@echo ">> ============= Checking Code Style ============= <<"
@fmtRes=$$($(GOFMT) -d $$(find . -path ./vendor -prune -o -name '*.go' -print)); \
@fmtRes=$$($(gofmt) -d $$(find . -path ./vendor -prune -o -name '*.go' -print)); \
if [ -n "$${fmtRes}" ]; then \
echo "gofmt checking failed!"; echo "$${fmtRes}"; echo; \
echo "Please ensure you are using $$($(GO) version) for formatting code."; \
echo "Please ensure you are using $$($(go) version) for formatting code."; \
exit 1; \
fi

Expand All @@ -48,24 +48,24 @@ check_license:
.PHONY: test_short
test_short:
@echo ">> ============= Running Short Tests ============= <<"
$(GO) clean -testcache
$(GO) test -mod=readonly -short $(pkgs)
$(go) clean -testcache
$(go) test -mod=readonly -short $(pkgs)


## test: Run test cases.
.PHONY: test
test:
@echo ">> ============= Running All Tests ============= <<"
$(GO) clean -testcache
$(GO) test -mod=readonly -run=Unit -bench=. -benchmem -v -cover $(pkgs)
$(go) clean -testcache
$(go) test -mod=readonly -run=Unit -bench=. -benchmem -v -cover $(pkgs)


## integration: Run integration test cases (Requires Redis)
.PHONY: integration
integration:
@echo ">> ============= Running All Tests ============= <<"
$(GO) clean -testcache
$(GO) test -mod=readonly -run=Integration -bench=. -benchmem -v -cover $(pkgs)
$(go) clean -testcache
$(go) test -mod=readonly -run=Integration -bench=. -benchmem -v -cover $(pkgs)


## lint: Lint the code.
Expand All @@ -79,39 +79,39 @@ lint:
.PHONY: verify
verify:
@echo ">> ============= List Dependencies ============= <<"
$(GO) list -m all
$(go) list -m all
@echo ">> ============= Verify Dependencies ============= <<"
$(GO) mod verify
$(go) mod verify


## format: Format the code.
.PHONY: format
format:
@echo ">> ============= Formatting Code ============= <<"
$(GO) fmt $(pkgs)
$(go) fmt $(pkgs)


## vet: Examines source code and reports suspicious constructs.
.PHONY: vet
vet:
@echo ">> ============= Vetting Code ============= <<"
$(GO) vet $(pkgs)
$(go) vet $(pkgs)


## coverage: Create HTML coverage report
.PHONY: coverage
coverage:
@echo ">> ============= Coverage ============= <<"
rm -f coverage.html cover.out
$(GO) test -mod=readonly -coverprofile=cover.out $(pkgs)
$(go) test -mod=readonly -coverprofile=cover.out $(pkgs)
go tool cover -html=cover.out -o coverage.html


## run: Run the API Server
.PHONY: run
run:
@echo ">> ============= Run API Server ============= <<"
$(GO) run helmet.go server -c config.test.yml
$(go) run helmet.go server -c config.test.yml


## ci: Run all CI tests.
Expand All @@ -124,7 +124,7 @@ ci: style check_license test vet lint
.PHONY: api
api:
@echo ">> ====== Call API Endpoints With Poodle ====== <<"
$(POODLE) call -f .poodle.toml
$(poodle) call -f .poodle.toml


.PHONY: help
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.17

require (
github.com/drone/envsubst v1.0.3
github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2
github.com/franela/goblin v0.0.0-20211003143422-0a4f594942bf
github.com/go-redis/redis v6.15.9+incompatible
github.com/jinzhu/gorm v1.9.16
github.com/labstack/echo-contrib v0.12.0
Expand Down Expand Up @@ -35,7 +35,7 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.18.1 // indirect
github.com/onsi/gomega v1.19.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
Expand Down
Loading

0 comments on commit 26f94c6

Please sign in to comment.