migrate make -> just

This commit is contained in:
Aine 2023-01-10 12:48:26 +02:00
parent 7d940b6ee4
commit a776108dd5
No known key found for this signature in database
GPG Key ID: 34969C908CCA2804
3 changed files with 35 additions and 45 deletions

View File

@ -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

View File

@ -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
View 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