Skip to content

Commit

Permalink
chore: Update Makefile to test in container
Browse files Browse the repository at this point in the history
  • Loading branch information
valerena committed Mar 27, 2024
1 parent e007fb3 commit f38a221
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,33 @@ DESTINATION_old:= bin/${BINARY_NAME}
DESTINATION_x86_64 := bin/${BINARY_NAME}-x86_64
DESTINATION_arm64 := bin/${BINARY_NAME}-arm64

run_in_docker = docker run --env GOPROXY=direct -v $(shell pwd):/LambdaRuntimeLocal -w /LambdaRuntimeLocal golang:1.22.1 $(1)

compile-with-docker-all:
make ARCH=x86_64 compile-with-docker
make ARCH=arm64 compile-with-docker
make ARCH=old compile-with-docker
$(call run_in_docker, make compile-lambda-linux-all)

compile-lambda-linux-all:
make ARCH=x86_64 compile-lambda-linux
make ARCH=arm64 compile-lambda-linux
make ARCH=old compile-lambda-linux

compile-with-docker:
docker run --env GOPROXY=direct -v $(shell pwd):/LambdaRuntimeLocal -w /LambdaRuntimeLocal golang:1.22 make ARCH=${ARCH} compile-lambda-linux
$(call run_in_docker, make ARCH=${ARCH} compile-lambda-linux)

compile-lambda-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=${GO_ARCH_${ARCH}} go build -buildvcs=false -ldflags "${RELEASE_BUILD_LINKER_FLAGS}" -o ${DESTINATION_${ARCH}} ./cmd/aws-lambda-rie

tests-with-docker:
$(call run_in_docker, make tests)

tests:
go test ./...

integ-tests-and-compile: tests
make compile-lambda-linux-all
make integ-tests

integ-tests-with-docker: tests
integ-tests-with-docker: tests-with-docker
make compile-with-docker-all
make integ-tests

Expand Down

0 comments on commit f38a221

Please sign in to comment.