Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
--output text) artillery run tests/load-test.yml
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ 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

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

Expand Down