1
0
mirror of https://github.com/go-task/task.git synced 2024-12-12 10:45:49 +02:00
task/Taskfile.yml

130 lines
2.5 KiB
YAML
Raw Normal View History

2019-07-07 19:18:02 +02:00
version: '3'
2018-03-04 21:20:26 +02:00
includes:
2020-02-16 16:20:53 +02:00
docs:
2022-10-15 00:28:27 +02:00
aliases: [d]
2020-02-16 16:20:53 +02:00
taskfile: ./docs
dir: ./docs
env:
CGO_ENABLED: '0'
2018-03-04 21:20:26 +02:00
tasks:
2018-07-15 20:42:46 +02:00
default:
cmds:
- 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-10-15 00:28:27 +02:00
aliases: [i]
sources:
- './**/*.go'
2018-03-04 21:20:26 +02:00
cmds:
- go install -v ./cmd/task
2018-03-04 21:20:26 +02:00
generate:
desc: Runs Go generate to create mocks
aliases: [gen, g]
deps: [install:mockgen]
sources:
- "internal/fingerprint/checker.go"
generates:
- "internal/fingerprint/checker_mock.go"
cmds:
- mockgen -source=internal/fingerprint/checker.go -destination=internal/fingerprint/checker_mock.go -package=fingerprint
install:mockgen:
desc: Installs mockgen; a tool to generate mock files
status:
- command -v mockgen &>/dev/null
cmds:
- go install github.com/golang/mock/mockgen@latest
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/
- rm -rf tmp/
2018-03-04 21:20:26 +02:00
lint:
desc: Runs golangci-lint
2022-10-15 00:28:27 +02:00
aliases: [l]
sources:
- './**/*.go'
2022-12-17 16:02:17 +02:00
- .golangci.yml
cmds:
- golangci-lint run
2023-03-31 21:13:29 +02:00
lint:fix:
desc: Runs golangci-lint and fixes any issues
sources:
- './**/*.go'
- .golangci.yml
cmds:
- golangci-lint run --fix
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-10-15 00:28:27 +02:00
aliases: [t]
deps: [install]
2018-03-04 21:20:26 +02:00
cmds:
2018-07-15 20:42:46 +02:00
- go test {{catLines .GO_PACKAGES}}
vars:
GO_PACKAGES:
sh: go list ./...
2018-03-04 21:20:26 +02:00
test:all:
desc: Runs test suite with signals and watch tests included
deps: [install, sleepit:build]
cmds:
- go test {{catLines .GO_PACKAGES}} -tags 'signals watch'
vars:
GO_PACKAGES:
sh: go list ./...
2018-03-04 21:20:26 +02:00
test-release:
desc: Tests release process without publishing
cmds:
- goreleaser --snapshot --rm-dist
2018-03-04 21:20:26 +02:00
2023-03-26 17:32:20 +02:00
release:
desc: Prepare the project for a new release
2022-09-09 02:21:39 +02:00
cmds:
2023-03-26 17:32:20 +02:00
- go run ./cmd/release {{.CLI_ARGS}}
2022-09-09 02:21:39 +02:00
npm:publish:
desc: Publish release to npm
cmds:
- npm publish --access=public
2018-07-15 20:42:46 +02:00
packages:
cmds:
- echo '{{.GO_PACKAGES}}'
vars:
GO_PACKAGES:
sh: go list ./...
2018-07-15 20:42:46 +02:00
silent: true