From 5c019baa780793698842a07ba451d1fdf561c94f Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Wed, 18 Mar 2026 19:29:01 -0400 Subject: [PATCH] refactor: use make in CI, pull module in make docs Instead of duplicating test logic in both the CI and the Makefile, I made the CI call the Makefile. Also, updated `make docs` so it dynamically pulls the module name from `go list -m`. --- .gitea/workflows/ci.yml | 9 +++------ Makefile | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d5d0a9d..04d2d5b 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: go-version-file: go.mod - name: Run unit tests - run: go test ./... -cover -v + run: name test-unit fuzz-test: name: Fuzz Tests @@ -47,10 +47,7 @@ jobs: go-version-file: go.mod - name: Run fuzz tests - run: | - for func in $(grep -r --include='*_test.go' -oh 'func Fuzz\w*' . | sed 's/func //'); do - go test ./... -fuzz="^${func}$" -fuzztime=30s - done + run: make test-fuzz mutation-test: name: Mutation Tests @@ -66,4 +63,4 @@ jobs: run: go install github.com/go-gremlins/gremlins/cmd/gremlins@latest - name: Run mutation tests - run: gremlins unleash + run: make test-mutation diff --git a/Makefile b/Makefile index dd5baea..57a7650 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ lint-makefile: ## Lint the Makefile lint: lint-go lint-makefile ## Lint all code docs: ## Serve godoc locally - @echo ">>> Visit: http://localhost:6060/pkg/git.maximhutz.com/tools/dsa/" + @echo ">>> Visit: http://localhost:6060/pkg/$$(go list -m)" godoc -http=:6060 clean: ## Clean build and test caches