version: "3" tasks: coverage: deps: [test] desc: run unit tests and create HTML coverage file cmds: - go tool cover -html=coverage.txt fmt: desc: auto-format all go files sources: - "**/*.go" cmds: - go fmt ./... mocks: desc: generate new mocks from scratch deps: [mocks.remove, mocks.generate] mocks.remove: desc: remove all mock files cmds: - find . -name '*_mock.go' -o -name 'mock_*_test.go' | xargs -r rm - rm -rf mocks/ mocks.generate: desc: generate mockery mocks cmds: - go run . docker: desc: build the mockery docker image cmds: - docker build -t vektra/mockery . mkdocs.install: desc: install mkdocs and plugins sources: - "docs/requirements.txt" cmds: - pip install -r docs/requirements.txt mkdocs.serve: desc: serve mkdocs locally deps: [mkdocs.install] cmds: - mkdocs serve lint: desc: run all the defined linters sources: - "**/*.go" cmds: - go run github.com/golangci/golangci-lint/cmd/golangci-lint run test: cmds: - go run gotest.tools/gotestsum --format testname -- -v -coverprofile=coverage.txt ./... desc: run unit tests sources: - "**/*.go" generates: - coverage.txt test.e2e: desc: run end-to-end tests sources: - "**/*.go" - "./.mockery.yaml" cmds: - ./e2e/run_all.sh test.ci: deps: [fmt, lint] cmds: - task: mocks.remove - task: mocks.generate - task: test - task: test.e2e default: deps: [test.ci] build-tools: desc: Build tools directory cmds: - cd ./tools && go build -o tools . tag: desc: Tag the git repo with the version specified. deps: [build-tools] cmds: - ./tools/tools tag --dry-run=false tag.push: desc: Push tags to origin cmds: - git push origin --tags --force