-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Taskfile to automate common command line tasks that are used in the development process.
- Loading branch information
1 parent
2383487
commit 0813ea8
Showing
1 changed file
with
66 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
version: '3' | ||
|
||
tasks: | ||
build: | ||
desc: Build app. | ||
cmds: | ||
- go build -v -race | ||
|
||
check: | ||
desc: Format, lint and test app. | ||
cmds: | ||
- task: fmt | ||
- task: lint | ||
- task: test | ||
|
||
test: | ||
desc: Test app. | ||
cmds: | ||
- go test ./... | ||
|
||
lint: | ||
desc: Run Go, Docker and Markdown linters. | ||
cmds: | ||
- golangci-lint run ./... | ||
- hadolint --failure-threshold error Dockerfile | ||
- markdownlint --disable MD013 MD025 MD033 -- README.md | ||
|
||
fmt: | ||
desc: Format Go files. | ||
cmds: | ||
- gofumpt -l -w . | ||
|
||
release: | ||
desc: Build release version. | ||
cmds: | ||
- go build -v -tags release | ||
|
||
clean: | ||
desc: Remove cache and temporary files. | ||
cmds: | ||
- go clean -testcache | ||
- rm -f committed | ||
- rm -f coverage.txt | ||
- rm -rf dist | ||
|
||
module:update: | ||
desc: Update Go modules. | ||
cmds: | ||
- go get -u | ||
|
||
module:tidy: | ||
desc: Tidy Go modules. | ||
cmds: | ||
- go mod tidy | ||
|
||
coverage: | ||
desc: Generate Go coverage report. | ||
cmds: | ||
- go test -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
- go tool cover -func=coverage.txt | ||
- rm coverage.txt | ||
|
||
docker:build: | ||
desc: Build app image. | ||
cmds: | ||
- docker build --rm --tag committed . |