Skip to content

Commit f38a221

Browse files
committed
chore: Update Makefile to test in container
1 parent e007fb3 commit f38a221

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Makefile

+8-5
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,33 @@ DESTINATION_old:= bin/${BINARY_NAME}
1010
DESTINATION_x86_64 := bin/${BINARY_NAME}-x86_64
1111
DESTINATION_arm64 := bin/${BINARY_NAME}-arm64
1212

13+
run_in_docker = docker run --env GOPROXY=direct -v $(shell pwd):/LambdaRuntimeLocal -w /LambdaRuntimeLocal golang:1.22.1 $(1)
14+
1315
compile-with-docker-all:
14-
make ARCH=x86_64 compile-with-docker
15-
make ARCH=arm64 compile-with-docker
16-
make ARCH=old compile-with-docker
16+
$(call run_in_docker, make compile-lambda-linux-all)
1717

1818
compile-lambda-linux-all:
1919
make ARCH=x86_64 compile-lambda-linux
2020
make ARCH=arm64 compile-lambda-linux
2121
make ARCH=old compile-lambda-linux
2222

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

2626
compile-lambda-linux:
2727
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
2828

29+
tests-with-docker:
30+
$(call run_in_docker, make tests)
31+
2932
tests:
3033
go test ./...
3134

3235
integ-tests-and-compile: tests
3336
make compile-lambda-linux-all
3437
make integ-tests
3538

36-
integ-tests-with-docker: tests
39+
integ-tests-with-docker: tests-with-docker
3740
make compile-with-docker-all
3841
make integ-tests
3942

0 commit comments

Comments
 (0)