- Require Go 1.27.3: fixes the standard library vulnerabilities govulncheck reported - Add the GPLv3 text and the licence note - Move shadcn to devDependencies: npm audit finds nothing in production dependencies - Add make lint (staticcheck) to go-ci and a separate vuln job in CI - Fix the staticcheck warning in a test
43 lines
1.1 KiB
Makefile
43 lines
1.1 KiB
Makefile
.PHONY: all admin test build e2e clean fmt-check lint vuln go-ci admin-ci ci
|
|
|
|
all: admin build
|
|
|
|
# Build the admin UI into internal/adminui/dist, which the Go binary embeds.
|
|
admin:
|
|
cd admin && npm ci && npm run build
|
|
|
|
build:
|
|
go build -o parsimony ./cmd/parsimony
|
|
|
|
test:
|
|
go test ./...
|
|
cd admin && npm test
|
|
|
|
# CI jobs. `make ci` runs them all locally, exactly as the workflow does.
|
|
fmt-check:
|
|
@unformatted="$$(gofmt -l .)"; if [ -n "$$unformatted" ]; then echo "gofmt needed:"; echo "$$unformatted"; exit 1; fi
|
|
|
|
lint:
|
|
go run honnef.co/go/tools/cmd/staticcheck@v0.8.2 ./...
|
|
|
|
# Known vulnerabilities in the Go standard library and dependencies, only for code the project calls.
|
|
vuln:
|
|
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
|
|
|
|
go-ci: fmt-check lint
|
|
go vet ./...
|
|
go test -race -count=1 ./...
|
|
|
|
admin-ci:
|
|
cd admin && npm ci && npm test && npm run build
|
|
|
|
ci: go-ci admin-ci build
|
|
|
|
# End-to-end test: parsimony behind a real Postfix, both in Docker (needs a running Docker daemon).
|
|
# Set E2E_PARSIMONY_IMAGE to reuse an image instead of building one.
|
|
e2e:
|
|
go test -tags e2e -count=1 -timeout 15m -v ./e2e
|
|
|
|
clean:
|
|
rm -f parsimony
|
|
node admin/scripts/clean.mjs
|