2019-07-07 19:18:02 +02:00
|
|
|
version: '3'
|
2018-03-04 21:20:26 +02:00
|
|
|
|
2019-01-02 17:42:06 +02:00
|
|
|
includes:
|
2020-02-16 16:20:53 +02:00
|
|
|
docs:
|
|
|
|
taskfile: ./docs
|
|
|
|
dir: ./docs
|
2019-01-02 17:42:06 +02:00
|
|
|
|
2018-04-07 19:42:24 +02:00
|
|
|
vars:
|
|
|
|
GIT_COMMIT:
|
|
|
|
sh: git log -n 1 --format=%h
|
|
|
|
|
|
|
|
GO_PACKAGES:
|
2018-07-15 20:42:46 +02:00
|
|
|
sh: go list ./...
|
2018-04-07 19:42:24 +02:00
|
|
|
|
2021-03-07 14:30:33 +02:00
|
|
|
env:
|
|
|
|
CGO_ENABLED: '0'
|
|
|
|
|
2018-03-04 21:20:26 +02:00
|
|
|
tasks:
|
2018-07-15 20:42:46 +02:00
|
|
|
default:
|
|
|
|
cmds:
|
2022-05-15 02:00:15 +02:00
|
|
|
- task: lint
|
2018-07-15 20:42:46 +02:00
|
|
|
- task: test
|
|
|
|
|
2018-03-04 21:20:26 +02:00
|
|
|
install:
|
|
|
|
desc: Installs Task
|
2022-06-12 02:32:06 +02:00
|
|
|
sources:
|
|
|
|
- './**/*.go'
|
2018-03-04 21:20:26 +02:00
|
|
|
cmds:
|
|
|
|
- go install -v -ldflags="-w -s -X main.version={{.GIT_COMMIT}}" ./cmd/task
|
|
|
|
|
2020-12-06 00:08:45 +02:00
|
|
|
mod:
|
|
|
|
desc: Downloads and tidy Go modules
|
|
|
|
cmds:
|
|
|
|
- go mod download
|
|
|
|
- go mod tidy
|
|
|
|
|
2018-03-04 21:20:26 +02:00
|
|
|
clean:
|
|
|
|
desc: Cleans temp files and folders
|
|
|
|
cmds:
|
|
|
|
- rm -rf dist/
|
2021-04-20 17:33:01 +02:00
|
|
|
- rm -rf tmp/
|
2018-03-04 21:20:26 +02:00
|
|
|
|
2022-05-15 02:00:15 +02:00
|
|
|
lint:
|
|
|
|
desc: Runs golangci-lint
|
2022-06-12 02:32:06 +02:00
|
|
|
sources:
|
|
|
|
- './**/*.go'
|
2022-05-15 02:00:15 +02:00
|
|
|
cmds:
|
|
|
|
- golangci-lint run
|
|
|
|
|
2022-06-12 02:32:06 +02:00
|
|
|
sleepit:build:
|
|
|
|
desc: Builds the sleepit test helper
|
|
|
|
sources:
|
|
|
|
- ./cmd/sleepit/**/*.go
|
|
|
|
generates:
|
|
|
|
- ./bin/sleepit
|
|
|
|
cmds:
|
|
|
|
- go build -o ./bin/sleepit{{exeExt}} ./cmd/sleepit
|
|
|
|
|
|
|
|
sleepit:run:
|
|
|
|
desc: Builds the sleepit test helper
|
|
|
|
deps: [sleepit:build]
|
|
|
|
cmds:
|
|
|
|
- ./bin/sleepit {{.CLI_ARGS}}
|
|
|
|
silent: true
|
|
|
|
|
2018-03-04 21:20:26 +02:00
|
|
|
test:
|
|
|
|
desc: Runs test suite
|
2022-06-15 15:02:45 +02:00
|
|
|
deps: [install]
|
2018-03-04 21:20:26 +02:00
|
|
|
cmds:
|
2018-07-15 20:42:46 +02:00
|
|
|
- go test {{catLines .GO_PACKAGES}}
|
2018-03-04 21:20:26 +02:00
|
|
|
|
2022-06-15 15:02:45 +02:00
|
|
|
test:signals:
|
|
|
|
desc: Runs test suite with signals tests included
|
|
|
|
deps: [install, sleepit:build]
|
|
|
|
cmds:
|
|
|
|
- go test {{catLines .GO_PACKAGES}} -tags signals
|
|
|
|
|
2018-03-04 21:20:26 +02:00
|
|
|
test-release:
|
|
|
|
desc: Tests release process without publishing
|
|
|
|
cmds:
|
2018-03-11 20:31:27 +02:00
|
|
|
- goreleaser --snapshot --rm-dist
|
2018-03-04 21:20:26 +02:00
|
|
|
|
2018-07-15 20:42:46 +02:00
|
|
|
packages:
|
|
|
|
cmds:
|
|
|
|
- echo '{{.GO_PACKAGES}}'
|
|
|
|
silent: true
|