mirror of
https://github.com/go-task/task.git
synced 2024-12-12 10:45:49 +02:00
73 lines
1.3 KiB
YAML
73 lines
1.3 KiB
YAML
version: '3'
|
|
|
|
includes:
|
|
docs:
|
|
taskfile: ./docs
|
|
dir: ./docs
|
|
|
|
vars:
|
|
GIT_COMMIT:
|
|
sh: git log -n 1 --format=%h
|
|
|
|
GO_PACKAGES:
|
|
sh: go list ./...
|
|
|
|
env:
|
|
CGO_ENABLED: '0'
|
|
|
|
tasks:
|
|
default:
|
|
cmds:
|
|
- task: lint
|
|
- task: test
|
|
|
|
install:
|
|
desc: Installs Task
|
|
cmds:
|
|
- go install -v -ldflags="-w -s -X main.version={{.GIT_COMMIT}}" ./cmd/task
|
|
|
|
mod:
|
|
desc: Downloads and tidy Go modules
|
|
cmds:
|
|
- go mod download
|
|
- go mod tidy
|
|
|
|
clean:
|
|
desc: Cleans temp files and folders
|
|
cmds:
|
|
- rm -rf dist/
|
|
- rm -rf tmp/
|
|
|
|
sleepit:
|
|
desc: Builds the sleepit test helper
|
|
dir: tmp
|
|
cmds:
|
|
- go build ../internal/sleepit
|
|
|
|
lint:
|
|
desc: Runs golangci-lint
|
|
cmds:
|
|
- golangci-lint run
|
|
|
|
test:
|
|
desc: Runs test suite
|
|
deps: [install, sleepit]
|
|
cmds:
|
|
- go test {{catLines .GO_PACKAGES}}
|
|
|
|
test-release:
|
|
desc: Tests release process without publishing
|
|
cmds:
|
|
- goreleaser --snapshot --rm-dist
|
|
|
|
gen-install-script:
|
|
desc: Generate install script using https://github.com/goreleaser/godownloader
|
|
cmds:
|
|
- godownloader --repo go-task/task -o install-task.sh
|
|
- cp ./install-task.sh ./docs/install.sh
|
|
|
|
packages:
|
|
cmds:
|
|
- echo '{{.GO_PACKAGES}}'
|
|
silent: true
|