From b73d519d5b84e52c49e26691db18efb2a0d74aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20Heikkil=C3=A4?= Date: Wed, 8 May 2024 12:12:51 +0300 Subject: [PATCH] chore: add Taskfile --- Taskfile.yaml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Taskfile.yaml diff --git a/Taskfile.yaml b/Taskfile.yaml new file mode 100644 index 0000000..7e4269f --- /dev/null +++ b/Taskfile.yaml @@ -0,0 +1,50 @@ +# This file lists all the tasks developers can run while developing this library. +# Run `task -a` to list all the available tasks +# See https://taskfile.dev/ for details +version: '3' + +tasks: + + setup: + desc: Install necessary tools + internal: true + silent: true + cmds: + - > + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | + sh -s -- -b {{ .GOPATH }}/bin v{{ .GOLANGCILINT_VERSION }} + status: + - command -v golangci-lint + - golangci-lint --version | grep -q "{{ .GOLANGCILINT_VERSION }}" + vars: + GOLANGCILINT_VERSION: 1.58.0 + GOPATH: + sh: go env GOPATH + + deps: + desc: Install necessary Go dependencies + internal: true + silent: true + cmds: + - go mod download + - go mod tidy + + format: + desc: Check Go formatting + cmds: + - go fmt ./... + + lint: + desc: Lint with golangci-lint + cmds: + - golangci-lint run --timeout=5m + + test: + desc: Run acceptance tests + deps: + - setup + - deps + - format + - lint + cmds: + - go test -v ./...