Development¶
Prerequisites¶
- Go 1.26.6+
- Task (task runner)
- Dagger (CI/CD engine)
- pre-commit
- Docker (for Redis integration tests)
Setup¶
git clone https://github.com/stuttgart-things/homerun-library.git
cd homerun-library
go mod download
pre-commit install
Running Tests¶
Unit tests (no Redis required)¶
Integration tests (need a running Redis)¶
The integration suite is behind a build tag so go test ./... stays hermetic.
See "Manual Redis for local integration testing" below for a server to point it at.
Full Dagger suite with report (starts Redis automatically)¶
Manual Redis for local integration testing¶
docker run -d --name redis-stack-server \
-p 6379:6379 \
-e REDIS_ARGS="--requirepass mypassword" \
redis/redis-stack-server:7.2.0-v18
export REDIS_PASSWORD=mypassword
go run tests/pitcher/pitch_message.go
Linting¶
The linter set is pinned in .golangci.yml so local runs and CI agree.
Vulnerability scanning¶
govulncheck reports only vulnerabilities that are actually reachable from this
module's code. It is a hard gate in CI: this is a library, so every finding
propagates into all seven homerun2 services that import it.
CI/CD¶
The project uses two GitHub Actions workflows:
| Workflow | Trigger | Purpose |
|---|---|---|
dagger-static-checks.yaml |
push to main, PR (incl. every push to it) |
Lint, unit tests, govulncheck |
dagger-tests.yaml |
push to main, PR (incl. every push to it) |
Integration tests with Redis |
Both carry a concurrency group keyed on the PR, so a new push cancels the run it supersedes.
Release¶
Releases follow semantic-release with the Angular commit convention:
feat:- minor version bumpfix:- patch version bumpfeat!:orBREAKING CHANGE:- major version bump
Branch Strategy¶
main- production branchfeature/**- new featuresfix/**- bug fixes