Files
wweir 8e5fd3e805 test(install): cover install.sh end to end from make test
install.sh was only syntax-checked (sh -n), so the install and upgrade paths,
the config-preservation contract and the failure modes for a malformed release
tarball had no coverage. Add an offline, unprivileged E2E test that builds its
own tarballs and installs into a temp prefix with --service none: fresh
install, an in-place upgrade that keeps an operator-edited config, --with-server,
a dry run that creates nothing, three malformed tarballs that must fail closed,
and the CLI surface. Wire it into make test as test-install and syntax-check
the new script.
2026-10-10 14:57:10 +08:00

40 lines
800 B
Makefile

MAKEFLAGS += --jobs all
GO:=CGO_ENABLED=0 go
default: test build
test: web check-scripts test-install
${GO} vet ./...
${GO} test ./...
.PHONY: check-scripts
check-scripts:
sh -n install.sh
sh -n install_e2e_test.sh
sh -n .github/sower.init
.PHONY: test-install
test-install:
sh install_e2e_test.sh
build: sower sowerd
.PHONY: web
web:
cd web && bun install --frozen-lockfile && bun run build
.PHONY: sower
sower: web
${GO} build -ldflags "\
-X main.version=$(shell git describe --tags --always) \
-X main.date=$(shell date +%Y-%m-%d)" \
-o sower ./cmd/sower
.PHONY: sowerd
sowerd:
${GO} build -ldflags "\
-X main.version=$(shell git describe --tags --always) \
-X main.date=$(shell date +%Y-%m-%d)" \
-o sowerd ./cmd/sowerd
clean:
rm -f sower sowerd sower.exe sowerd.exe