Skip to content

Commit

Permalink
makefile: run go-test as a subtarget of container build
Browse files Browse the repository at this point in the history
following what downstream does and run the unit tests before
starting to build the container as if unit tests fail, we
shouldn't even start building the container

Signed-off-by: Rewant Soni <[email protected]>
  • Loading branch information
rewantsoni committed Apr 3, 2024
1 parent 2d67dda commit 8d3ef8b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ COPY controllers/ controllers/
COPY config/ config/
COPY pkg/ pkg/
COPY service/ service/
# Run tests and linting
RUN make go-test

# Build
RUN make go-build
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ go-build: ## Run go build against code.
run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go

container-build: test-setup ## Build container image with the manager.
container-build: test-setup go-test ## Build container image with the manager.
$(IMAGE_BUILD_CMD) build -t ${IMG} .

container-push: ## Push container image with the manager.
Expand Down

0 comments on commit 8d3ef8b

Please sign in to comment.