Skip to main content

Build and test

You need Go and make. The Makefile pins the toolchain (GOTOOLCHAIN=go1.27.3); the go command fetches it if needed. The integration tests and make test-linux need Docker.

Build​

git clone https://github.com/loch-sh/lambda-runtime.git
cd lambda-runtime
make binaries # dist/loch-lambda-runtime-linux-amd64 and -arm64

Make targets​

TargetWhat it does
make buildBinary for the current platform in dist/loch-lambda-runtime
make binariesStatic Linux binaries for amd64 and arm64 in dist/
make vetgo vet, also for Linux and the integration tests
make testUnit tests with the race detector
make test-linuxUnit tests in a Linux container (process groups, /proc)
make coverCoverage
make integrationIntegration tests against the real AWS images
make release VERSION=vX.Y.ZBinaries, SBOMs and SHA256SUMS
make reproducibleTwo builds in two directories; fails unless the checksums match

Integration tests​

make integration runs go test -tags integration against the AWS base images (Node.js, Python, provided.al2023 with a Go bootstrap), under the production hardening: concurrent invocations, timeouts, errors, init errors, OOM, payload limits, SIGTERM, authentication with the AWS CLI and the AWS SDK for JavaScript. The CI runs them on amd64 and arm64.

The first pulls from mirror.gcr.io may answer "not found" or 429: the tests retry.

CI​

GitHub Actions (.github/workflows/ci.yml) runs gofmt, vet and unit tests, the reproducible build and the integration tests, on amd64 and arm64. Release tags also build, attest, sign and publish: see Releases.


"AWS" and "AWS Lambda" are trademarks of Amazon.com, Inc. or its affiliates. This project is not affiliated with or endorsed by Amazon. It implements the publicly documented AWS Lambda Runtime and Invoke APIs and contains no code from the AWS Lambda Runtime Interface Emulator.