Skip to content

Commit

Permalink
feat: add configuration input and localstack pro usage
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshCasper committed Mar 12, 2023
1 parent 75f237e commit 8c6f7dc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ jobs:
with:
image-tag: 'latest'
install-awslocal: 'true'
configuration: DEBUG=1
use-pro: 'true'
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}

- name: Run Tests against LocalStack
run: |
awslocal s3 mb s3://test
awslocal s3 ls
echo "Test Execution complete!"
echo "Test Execution complete!"
24 changes: 21 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,35 @@ inputs:
required: true
default: 'latest'
install-awslocal:
description: 'Whether to install the `awslocal` CLI into the build environment'
description: 'Whether to install the `awslocal` CLI into the environment'
required: true
default: 'true'
use-pro:
description: 'Whether to use LocalStack Pro (requires a valid API key)'
required: false
default: 'false'
configuration:
description: 'Configuration variables to use for LocalStack'
required: false
default: ''

runs:
using: "composite"
steps:
-
run: |
pip install pyopenssl -U
docker pull localstack/localstack:$IMAGE_TAG
if [ "$USE_PRO" = true ]; then
docker pull localstack/localstack-pro:"$IMAGE_TAG"
CONFIGURATION="$CONFIGURATION DNS_ADDRESS=0"
else
docker pull localstack/localstack:"$IMAGE_TAG"
fi
pip install localstack
localstack start -d
eval "${CONFIGURATION} localstack start -d"
localstack wait -t 30
if [ "$INSTALL_AWSLOCAL" = true ]; then
pip install awscli-local[ver1]
Expand All @@ -33,3 +49,5 @@ runs:
env:
IMAGE_TAG: "${{ inputs.image-tag }}"
INSTALL_AWSLOCAL: "${{ inputs.install-awslocal }}"
USE_PRO: "${{ inputs.use-pro }}"
CONFIGURATION: "${{ inputs.configuration }}"

0 comments on commit 8c6f7dc

Please sign in to comment.