mirror of
https://gitlab.com/etke.cc/emm.git
synced 2025-02-15 03:35:49 +00:00
migrate make -> just
This commit is contained in:
parent
7d940b6ee4
commit
a776108dd5
@ -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
|
||||
|
41
Makefile
41
Makefile
@ -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
|
||||
|
31
justfile
Normal file
31
justfile
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user