Files
free-turn-proxy/Taskfile.yml
T
samosvalishe 8427887902 chore(deps): обновить Go-зависимости, GitHub Actions и Task до последних версий
- go.mod: x/crypto v0.51.0 → v0.52.0, bump x509roots/fallback; indirect:
  klauspost/compress v1.18.6, x/mod v0.36.0, x/tools v0.45.0
- CI actions: checkout v6.0.2, setup-go v6.4.0, upload-artifact v7.0.1,
  docker/{qemu,buildx,login} v4.x, sbom-action v0.24.0, goreleaser-action
  v7.2.2, release-please-action v5.0.0
- TASK_VERSION v3.40.0 → v3.51.1
2026-05-23 01:49:34 +03:00

97 lines
2.4 KiB
YAML

version: '3'
vars:
BINARIES: client server
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null || echo dev
LDFLAGS: -s -w -checklinkname=0 -X main.version={{.VERSION}}
GOLANGCI_VERSION: v2.12.2
GOVULN_VERSION: v1.1.4
GORELEASER_VERSION: v2.15.4
TASK_VERSION: v3.51.1
tasks:
default:
cmds:
- task --list
silent: true
build:
desc: Build host binaries (client + server) to dist/
cmds:
- for: { var: BINARIES }
cmd: go build -ldflags "{{.LDFLAGS}}" -trimpath -o dist/{{.ITEM}} ./cmd/{{.ITEM}}
build:all:
desc: Cross-compile all targets via goreleaser snapshot
cmds:
- goreleaser release --snapshot --clean --skip=publish,sign
test:
desc: Run unit tests with race detector
cmds:
- go test -race -count=1 ./...
test:cover:
desc: Run tests with coverage report (cover.html)
cmds:
- go test -race -count=1 -coverprofile=cover.out ./...
- go tool cover -html=cover.out -o cover.html
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run --timeout=5m ./...
fmt:
desc: Format code (gofmt + goimports)
cmds:
- gofmt -w .
- goimports -w .
fmt:check:
desc: Verify formatting (fails on diff)
cmds:
- cmd: |
out=$(gofmt -l .)
if [ -n "$out" ]; then
echo "Files need formatting:"
echo "$out"
exit 1
fi
vet:
desc: Run go vet
cmds:
- go vet ./...
vuln:
desc: Run govulncheck
cmds:
- govulncheck ./...
tidy:
desc: Tidy go.mod / go.sum
cmds:
- go mod tidy
ci:
desc: Run full CI suite locally (fmt-check, vet, lint, test, vuln)
deps: [fmt:check, vet, lint, test, vuln]
tools:install:
desc: Install dev tools (golangci-lint, govulncheck, goreleaser, goimports)
cmds:
- go install golang.org/x/tools/cmd/goimports@latest
- go install golang.org/x/vuln/cmd/govulncheck@{{.GOVULN_VERSION}}
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_VERSION}}
- go install github.com/goreleaser/goreleaser/v2@{{.GORELEASER_VERSION}}
clean:
desc: Remove build artifacts
cmds:
- cmd: rm -rf dist/ cover.out cover.html
platforms: [linux, darwin]
- cmd: powershell -Command "Remove-Item -Recurse -Force dist,cover.out,cover.html -ErrorAction SilentlyContinue"
platforms: [windows]