diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c728b48..d648d31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,15 +4,15 @@ stages: lint: stage: test - image: registry.gitlab.com/etke.cc/base + image: registry.gitlab.com/etke.cc/base/build script: - - make lint + - just lint unit: stage: test - image: registry.gitlab.com/etke.cc/base + image: registry.gitlab.com/etke.cc/base/build script: - - make test + - just test release: stage: release diff --git a/Makefile b/Makefile deleted file mode 100644 index c41aa87..0000000 --- a/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -export CGO_CPPFLAGS=${CPPFLAGS} -export CGO_CFLAGS=${CFLAGS} -export CGO_CXXFLAGS=${CXXFLAGS} -export CGO_LDFLAGS=${LDFLAGS} -GOFLAGS ?= -buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw - -# update go dependencies -update: - go get ./cmd - go mod tidy - go mod vendor - -mock: - @mockery --all - -# run linter -lint: - golangci-lint run ./... - -# run linter and fix issues if possible -lintfix: - golangci-lint run --fix ./... - -# run unit tests -test: - @go test -coverprofile=cover.out ./... - @go tool cover -func=cover.out - -@rm -f cover.out - -# run emm, note: make doesn't understand exit code 130 and sets it == 1 -run: - @go run ./cmd || exit 0 - -install: build - @mv ./emm ${HOME}/go/bin/ - @echo "emm has been installed." - -# build emm -build: - go build -v -o emm ./cmd - diff --git a/justfile b/justfile new file mode 100644 index 0000000..c511049 --- /dev/null +++ b/justfile @@ -0,0 +1,31 @@ +# show help by default +default: + @just --list --justfile {{ justfile() }} + +# update go deps +update: + go get ./cmd + go mod tidy + go mod vendor + +# run linter +lint: + golangci-lint run ./... + +# automatically fix liter issues +lintfix: + golangci-lint run --fix ./... + +# run unit tests +test: + @go test -coverprofile=cover.out ./... + @go tool cover -func=cover.out + -@rm -f cover.out + +# run app +run: + @go run ./cmd + +# build app +build: + go build -v -o emm ./cmd