diff --git a/Makefile b/Makefile index 8fcac37..60232c6 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,21 @@ ARCH := aarch64-unknown-linux-gnu all: build tests-unit deploy tests-integ ci: build tests-unit +setup: +ifeq (,$(shell which rustc)) + $(error "Could not found Rust compiler, please install it") +endif +ifeq (,$(shell which cargo)) + $(error "Could not found Cargo, please install it") +endif + cargo install cross +ifeq (,$(shell which sam)) + $(error "Could not found SAM CLI, please install it") +endif +ifeq (,$(shell which artillery)) + $(error "Could not found Artillery, it's required for load testing") +endif + build: cross build --release --target $(ARCH) rm -rf ./build @@ -35,4 +50,4 @@ tests-integ: tests-load: API_URL=$$(aws cloudformation describe-stacks --stack-name $(STACK_NAME) \ --query 'Stacks[0].Outputs[?OutputKey==`ApiUrl`].OutputValue' \ - --output text) artillery run tests/load-test.yml \ No newline at end of file + --output text) artillery run tests/load-test.yml diff --git a/README.md b/README.md index afd0446..bb74124 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ If you want to learn more about Rust on Lambda and how this project is structure ### Requirements -* [Rust](https://www.rust-lang.org/) +* [Rust](https://www.rust-lang.org/) 1.56.0 or higher * [Cross](https://github.com/rust-embedded/cross) for cross-compilation to Arm64 -* The [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) for deploying to the cloud +* The [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) 1.33.0 or higher for deploying to the cloud * [Artillery](https://artillery.io/) for load-testing the application ### Commands @@ -28,6 +28,9 @@ If you want to learn more about Rust on Lambda and how this project is structure You can use the following commands at the root of this repository to test, build, and deploy this project: ```bash +# Optional: install Cross +make install-cross + # Run unit tests make tests-unit