-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace makefile with taskfile
Signed-off-by: AtomicFS <vojtech_vesely@white-hat-hacker.icu>
- Loading branch information
AtomicFS
committed
Sep 17, 2024
1 parent
1dd4fd8
commit 8062546
Showing
6 changed files
with
73 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
"words": [ | ||
"GOARCH", | ||
"GOARM", | ||
"Taskfile", | ||
"armv", | ||
"cocogitto", | ||
"commitlint", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
bmc-test-* | ||
bin/ | ||
coverage.html | ||
coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
version: '3' | ||
vars: | ||
SEMVER: 'v0.0.0' | ||
|
||
tasks: | ||
build: | ||
desc: Build go binary | ||
cmds: | ||
# For Matrix build a Taskfile v3.39.0 or newer is needed | ||
- for: | ||
matrix: | ||
OS: ['linux'] | ||
ARCH: ['amd64', 'arm', 'arm64'] | ||
cmd: GOOS="{{.ITEM.OS}}" GOARCH="{{.ITEM.ARCH}}" go build -ldflags="-s -w" -o "bin/bmc-test-go-{{.ITEM.OS}}-{{.ITEM.ARCH}}-{{.SEMVER}}" | ||
|
||
lint: | ||
desc: Run linters | ||
cmds: | ||
- task: lint:revive | ||
- task: lint:vet | ||
- task: lint:staticcheck | ||
- task: lint:golangci-lint | ||
|
||
lint:revive: | ||
desc: Faster and stricter golint replacement | ||
cmds: | ||
- revive ./... | ||
|
||
lint:vet: | ||
desc: Reports suspicious constructs | ||
cmds: | ||
- go vet ./... | ||
|
||
lint:staticcheck: | ||
desc: Static analysis and style rules enforcer | ||
cmds: | ||
- staticcheck -fail "" ./... | ||
|
||
lint:golangci-lint: | ||
desc: Collection of golang linters | ||
cmds: | ||
- golangci-lint run --issues-exit-code 0 ./... | ||
|
||
format: | ||
desc: Run gofumt (fork of gofmt, stricter) to format the code | ||
cmds: | ||
- gofumpt -w . | ||
|
||
test: | ||
desc: Run unit-tests | ||
cmds: | ||
- go test {{.CLI_ARGS}} -race -timeout 60m -shuffle=on -covermode=atomic -coverprofile coverage.out ./... | ||
- go tool cover -func=coverage.out | ||
- go tool cover -html=coverage.out -o coverage.html |