mirror of
https://github.com/go-task/task.git
synced 2024-12-12 10:45:49 +02:00
0ec8cf1b53
Testing signals requires additional executables to be available in the $PATH and can intermittently fail as well. Add a build tag, which means these specific tests will only run when requested. Closes #780
87 lines
1.5 KiB
YAML
87 lines
1.5 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
|
|
sources:
|
|
- './**/*.go'
|
|
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/
|
|
|
|
lint:
|
|
desc: Runs golangci-lint
|
|
sources:
|
|
- './**/*.go'
|
|
cmds:
|
|
- golangci-lint run
|
|
|
|
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
|
|
|
|
test:
|
|
desc: Runs test suite
|
|
deps: [install]
|
|
cmds:
|
|
- go test {{catLines .GO_PACKAGES}}
|
|
|
|
test:signals:
|
|
desc: Runs test suite with signals tests included
|
|
deps: [install, sleepit:build]
|
|
cmds:
|
|
- go test {{catLines .GO_PACKAGES}} -tags signals
|
|
|
|
test-release:
|
|
desc: Tests release process without publishing
|
|
cmds:
|
|
- goreleaser --snapshot --rm-dist
|
|
|
|
packages:
|
|
cmds:
|
|
- echo '{{.GO_PACKAGES}}'
|
|
silent: true
|