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`.
This commit is contained in:
@@ -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
|
||||
|
||||
2
Makefile
2
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
|
||||
|
||||
Reference in New Issue
Block a user