Monolithic test-build-push job runs all steps sequentially, with conditionals for push only on main. This makes it hard to see what failed and doesn't clearly separate concerns.
Fix
Split into two jobs:
test: Runs on all branches + PRs (go mod, vet, test, build binary)
build-push: Runs only on main push after test passes
Move env vars to workflow level (cleaner, reused by both jobs).
Result
PRs: test job runs ✅ (no docker install, no registry push) ✅
Main push: test → build-push → registry push ✅
## Problem
Monolithic test-build-push job runs all steps sequentially, with conditionals for push only on main. This makes it hard to see what failed and doesn't clearly separate concerns.
## Fix
Split into two jobs:
- **test**: Runs on all branches + PRs (go mod, vet, test, build binary)
- **build-push**: Runs only on main push after test passes
Move env vars to workflow level (cleaner, reused by both jobs).
## Result
- PRs: test job runs ✅ (no docker install, no registry push) ✅
- Main push: test → build-push → registry push ✅
Changes:
- Split monolithic test-build-push into separate jobs
- test job: runs on all branches + PRs
- build-push job: only runs on main push after test passes
- Move env vars to workflow level (GOPRIVATE, REGISTRY, IMAGE)
- Remove conditional docker installs - only in build-push
- Build-push depends on test passing
Now: PRs run tests only. Main pushes build image to registry.
rock
merged commit 0261ad141b into main2026-09-07 06:24:00 +00:00
rock
deleted branch fix/separate-test-build-push2026-09-07 06:24:04 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Monolithic test-build-push job runs all steps sequentially, with conditionals for push only on main. This makes it hard to see what failed and doesn't clearly separate concerns.
Fix
Split into two jobs:
Move env vars to workflow level (cleaner, reused by both jobs).
Result