Files
releaser/Taskfile.yml
T
k3nny e2d4214405
ci / vet, staticcheck, test, build (push) Failing after 3m50s
docs(releaser): release v1.5.1 — documentation site, fuzzing completeness
- Add Hugo + Geekdoc documentation site (docs/): installation, CLI
  reference, configuration, CI integration, and changelog pages; explicit
  menu bundle nav so all pages appear in the sidebar on every page
- Add Gitea CI workflow (.gitea/workflows/docs.yml): builds on push to
  main when docs/** changes, deploys minified site to gh-pages branch
- Add docs:setup / docs:serve / docs:build Taskfile tasks; theme bundle
  downloaded at build time (not committed)
- Add FuzzUpdate to internal/changelog and FuzzWriteVersion to
  internal/node to complete fuzz coverage for all file-rewriting packages
- Add fuzzing completeness guidelines to CLAUDE.md: authoritative table,
  exempt-package rationale, seed corpus rules

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-11 17:47:26 +02:00

129 lines
3.1 KiB
YAML

version: "3"
vars:
BIN: ./bin/releaser
PKG: ./...
FUZZ_TIME: 30s
GEEKDOC_VERSION: "v4.1.1"
tasks:
default:
desc: List available tasks
silent: true
cmds:
- task --list
build:
desc: Build the binary to ./bin/releaser
cmds:
- mkdir -p bin
- CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o {{.BIN}} ./cmd
sources:
- "**/*.go"
- go.mod
generates:
- "{{.BIN}}"
run:
desc: Build and run releaser (pass args with -- e.g. task run -- --dry-run)
deps: [build]
cmds:
- "{{.BIN}} {{.CLI_ARGS}}"
test:
desc: Run all tests (seed corpus only, no fuzzing)
cmds:
- go test {{.PKG}}
cov:
desc: Run tests with coverage and open HTML report
cmds:
- go test -coverprofile=coverage.out {{.PKG}}
- go tool cover -html=coverage.out -o coverage.html
- echo "Coverage report written to coverage.html"
cov:text:
desc: Run tests with per-function coverage in terminal
cmds:
- go test -coverprofile=coverage.out {{.PKG}}
- go tool cover -func=coverage.out
lint:
desc: Run go vet
cmds:
- go vet {{.PKG}}
fmt:
desc: Format all Go source files
cmds:
- gofmt -w .
tidy:
desc: Tidy go.mod and go.sum
cmds:
- go mod tidy
fuzz:
desc: "Fuzz a target for FUZZ_TIME (default 30s). Usage: task fuzz PKG=./internal/commits TARGET=FuzzParse"
vars:
PKG: '{{.PKG | default "./internal/commits"}}'
TARGET: '{{.TARGET | default "FuzzParse"}}'
cmds:
- go test -fuzz={{.TARGET}} -fuzztime={{.FUZZ_TIME}} {{.PKG}}
fuzz:all:
desc: Run all fuzz seed corpora (same as test but explicit)
cmds:
- go test -run='^Fuzz' {{.PKG}}
ci:
desc: Full CI pipeline — tidy check, vet, test
cmds:
- task: tidy
- |
if git rev-parse --git-dir >/dev/null 2>&1 && ! git diff --quiet go.mod go.sum; then
echo "go.mod/go.sum not tidy — run: task tidy" >&2
exit 1
fi
- task: lint
- task: test
clean:
desc: Remove build artifacts and coverage files
cmds:
- rm -rf bin/ coverage.out coverage.html
docker:build:
desc: Build the Docker image
vars:
TAG: '{{.TAG | default "releaser:dev"}}'
cmds:
- docker build -t {{.TAG}} .
docker:run:
desc: Run the Docker image (pass args with -- )
vars:
TAG: '{{.TAG | default "releaser:dev"}}'
cmds:
- docker run --rm {{.TAG}} {{.CLI_ARGS}}
docs:setup:
desc: Download Geekdoc theme into docs/themes/geekdoc/
cmds:
- mkdir -p docs/themes/geekdoc
- curl -sSL "https://github.com/thegeeklab/hugo-geekdoc/releases/download/{{.GEEKDOC_VERSION}}/hugo-geekdoc.tar.gz" | tar xz -C docs/themes/geekdoc
status:
- test -f docs/themes/geekdoc/theme.toml
docs:serve:
desc: Serve docs locally with live reload (requires hugo)
deps: [docs:setup]
cmds:
- hugo server --source docs
docs:build:
desc: Build docs to docs/public/ (requires hugo)
deps: [docs:setup]
cmds:
- hugo --source docs --destination public --minify