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:
|
2022-10-15 00:28:27 +02:00
|
|
|
aliases: [d]
|
2020-02-16 16:20:53 +02:00
|
|
|
taskfile: ./docs
|
|
|
|
dir: ./docs
|
2019-01-02 17:42:06 +02:00
|
|
|
|
2023-04-15 22:27:14 +02:00
|
|
|
vars:
|
|
|
|
BIN: "{{.ROOT_DIR}}/bin"
|
|
|
|
|
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-10-15 00:28:27 +02:00
|
|
|
aliases: [i]
|
2022-06-12 02:32:06 +02:00
|
|
|
sources:
|
|
|
|
- './**/*.go'
|
2018-03-04 21:20:26 +02:00
|
|
|
cmds:
|
2023-03-27 02:14:19 +02:00
|
|
|
- go install -v ./cmd/task
|
2018-03-04 21:20:26 +02:00
|
|
|
|
2023-03-10 20:27:30 +02:00
|
|
|
generate:
|
|
|
|
desc: Runs Go generate to create mocks
|
|
|
|
aliases: [gen, g]
|
2023-04-15 22:27:14 +02:00
|
|
|
deps: [install:mockery]
|
2023-03-10 20:27:30 +02:00
|
|
|
sources:
|
|
|
|
- "internal/fingerprint/checker.go"
|
|
|
|
generates:
|
2023-04-15 22:27:14 +02:00
|
|
|
- "internal/mocks/*.go"
|
2023-03-10 20:27:30 +02:00
|
|
|
cmds:
|
2023-04-15 22:27:14 +02:00
|
|
|
- "{{.BIN}}/mockery --dir ./internal/fingerprint --name SourcesCheckable"
|
|
|
|
- "{{.BIN}}/mockery --dir ./internal/fingerprint --name StatusCheckable"
|
2023-03-10 20:27:30 +02:00
|
|
|
|
2023-04-15 22:27:14 +02:00
|
|
|
install:mockery:
|
2023-03-10 20:27:30 +02:00
|
|
|
desc: Installs mockgen; a tool to generate mock files
|
2023-04-15 22:27:14 +02:00
|
|
|
vars:
|
|
|
|
MOCKERY_VERSION: v2.24.0
|
|
|
|
env:
|
|
|
|
GOBIN: "{{.BIN}}"
|
2023-03-10 20:27:30 +02:00
|
|
|
status:
|
2023-04-15 22:27:14 +02:00
|
|
|
- go version -m {{.BIN}}/mockery | grep github.com/vektra/mockery | grep {{.MOCKERY_VERSION}}
|
2023-03-10 20:27:30 +02:00
|
|
|
cmds:
|
2023-04-15 22:27:14 +02:00
|
|
|
- go install github.com/vektra/mockery/v2@{{.MOCKERY_VERSION}}
|
2023-03-10 20:27:30 +02:00
|
|
|
|
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-10-15 00:28:27 +02:00
|
|
|
aliases: [l]
|
2022-06-12 02:32:06 +02:00
|
|
|
sources:
|
|
|
|
- './**/*.go'
|
2022-12-17 16:02:17 +02:00
|
|
|
- .golangci.yml
|
2022-05-15 02:00:15 +02:00
|
|
|
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
|
|
|
|
|
2022-06-12 02:32:06 +02:00
|
|
|
sleepit:build:
|
|
|
|
desc: Builds the sleepit test helper
|
|
|
|
sources:
|
|
|
|
- ./cmd/sleepit/**/*.go
|
|
|
|
generates:
|
2023-04-15 22:27:14 +02:00
|
|
|
- "{{.BIN}}/sleepit"
|
2022-06-12 02:32:06 +02:00
|
|
|
cmds:
|
2023-04-15 22:27:14 +02:00
|
|
|
- go build -o {{.BIN}}/sleepit{{exeExt}} ./cmd/sleepit
|
2022-06-12 02:32:06 +02:00
|
|
|
|
|
|
|
sleepit:run:
|
|
|
|
desc: Builds the sleepit test helper
|
|
|
|
deps: [sleepit:build]
|
|
|
|
cmds:
|
2023-04-15 22:27:14 +02:00
|
|
|
- "{{.BIN}}/sleepit {{.CLI_ARGS}}"
|
2022-06-12 02:32:06 +02:00
|
|
|
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]
|
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}}
|
2023-01-07 02:41:18 +02:00
|
|
|
vars:
|
|
|
|
GO_PACKAGES:
|
|
|
|
sh: go list ./...
|
2018-03-04 21:20:26 +02:00
|
|
|
|
2022-12-17 16:08:41 +02:00
|
|
|
test:all:
|
|
|
|
desc: Runs test suite with signals and watch tests included
|
2022-06-15 15:02:45 +02:00
|
|
|
deps: [install, sleepit:build]
|
|
|
|
cmds:
|
2022-12-17 16:08:41 +02:00
|
|
|
- go test {{catLines .GO_PACKAGES}} -tags 'signals watch'
|
2023-01-07 02:41:18 +02:00
|
|
|
vars:
|
|
|
|
GO_PACKAGES:
|
|
|
|
sh: go list ./...
|
2022-06-15 15:02:45 +02:00
|
|
|
|
2023-10-08 00:38:16 +02:00
|
|
|
goreleaser:test:
|
2018-03-04 21:20:26 +02:00
|
|
|
desc: Tests release process without publishing
|
|
|
|
cmds:
|
2023-08-10 03:50:07 +02:00
|
|
|
- goreleaser --snapshot --clean
|
2018-03-04 21:20:26 +02:00
|
|
|
|
2023-10-08 00:38:16 +02:00
|
|
|
goreleaser:install:
|
|
|
|
desc: Installs goreleaser
|
|
|
|
cmds:
|
|
|
|
- go install github.com/goreleaser/goreleaser@latest
|
|
|
|
|
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
|
|
|
|
2022-09-30 02:27:30 +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}}'
|
2023-01-07 02:41:18 +02:00
|
|
|
vars:
|
|
|
|
GO_PACKAGES:
|
|
|
|
sh: go list ./...
|
2018-07-15 20:42:46 +02:00
|
|
|
silent: true
|