From 5d554d926776200e2e1473f807f44c02200921e8 Mon Sep 17 00:00:00 2001 From: Dinis Cruz Date: Sun, 13 Oct 2024 19:52:06 +0100 Subject: [PATCH] added LocalStack gh action --- .github/actions/docker_local-stack/action.yml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/actions/docker_local-stack/action.yml diff --git a/.github/actions/docker_local-stack/action.yml b/.github/actions/docker_local-stack/action.yml new file mode 100644 index 0000000..597e33e --- /dev/null +++ b/.github/actions/docker_local-stack/action.yml @@ -0,0 +1,30 @@ +name: 'Start LocalStack' +description: 'Start LocalStack for testing' + +runs: + using: 'composite' + steps: + - name: Set up Docker + uses: docker/setup-buildx-action@v3 + + - name: Run LocalStack + shell: bash + run: | + docker run -d -p 4566:4566 -p 4510-4559:4510-4559 \ + -e SERVICES=s3,lambda,iam \ + -e AWS_ACCESS_KEY_ID=localstack \ + -e AWS_SECRET_ACCESS_KEY=localstack \ + --name localstack-server \ + localstack/localstack:latest + + - name: Wait for LocalStack to be ready + shell: bash + run: | + for i in {1..10}; do + if curl -s http://localhost:4566/_localstack/health; then + echo "LocalStack is ready" + break + fi + echo "Waiting for LocalStack..." + sleep 5 + done