Serverless LocalStack CI with GitHub Actions
1) Pre-requisites for Act
(WARNING! Commands in prereqs.sh remove Docker images) See prereqs.sh to manage the below steps in one script
Create custom Ubuntu Docker image needed by Act and a local registry to push it to
Push new ubuntu-builder image to local registry for use by Act
docker tag sls-localstack-example_act-ubuntu localhost:5000/ubuntu-builder
docker push localhost:5000/ubuntu-builder
docker rmi localhost:5000/ubuntu-builder
(Once above Pre-requisites are performed, start here for repeatable GitHub Actions testing)
Deploys LocalStack, sets up environment, installs Python, runs pytest, and deploys application via Serverless Framework
act --container-architecture linux/amd64 -P ubuntu-latest=localhost:5000/ubuntu-builder -P localstack/localstack:latest
(Need to integrate this into integration test within GitHub Actions)
aws --endpoint-url=http://localhost:4566 sts get-caller-identity
aws --endpoint-url=http://localhost:4566 s3 ls
sls invoke -f greeting --stage dev
Remove stack (this may fail with an unknown error leaving the LocalStack container in a weird state)