Adjust config to support LOCALSTACK_AUTH_TOKEN
in addition to legacy API keys
#124
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: LocalStack AWS Replicator Extension Tests | |
on: | |
push: | |
paths: | |
- aws-replicator/** | |
branches: | |
- main | |
pull_request: | |
paths: | |
- .github/workflows/aws-replicator.yml | |
- aws-replicator/** | |
workflow_dispatch: | |
jobs: | |
tests-aws-proxy: | |
name: Run extension tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Set up Terraform CLI | |
uses: hashicorp/setup-terraform@v2 | |
- name: Install LocalStack and extension | |
env: | |
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} | |
run: | | |
docker pull localstack/localstack-pro & | |
docker pull public.ecr.aws/lambda/python:3.8 & | |
# install latest CLI packages (dev releases) | |
pip install --upgrade --pre localstack localstack-ext | |
# TODO remove | |
mkdir ~/.localstack; echo '{"token":"test"}' > ~/.localstack/auth.json | |
# install dependencies | |
sudo apt-get update | |
sudo apt-get install -y libsasl2-dev | |
# build and install extension | |
localstack extensions init | |
( | |
cd aws-replicator | |
make install && make build && make enable | |
) | |
# install awslocal/tflocal command lines | |
pip install awscli-local[ver1] | |
pip install terraform-local | |
find /home/runner/.cache/localstack/volume/lib/extensions/python_venv/lib/python3.11/site-packages/aws* | |
ls -la /home/runner/.cache/localstack/volume/lib/extensions/python_venv/lib/python3.11/site-packages/aws* | |
DEBUG=1 localstack start -d | |
localstack wait | |
- name: Run linter | |
run: | | |
cd aws-replicator | |
(. .venv/bin/activate; pip install --upgrade --pre localstack localstack-ext) | |
make lint | |
- name: Run integration tests | |
env: | |
AWS_DEFAULT_REGION: us-east-1 | |
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }} | |
run: | | |
cd aws-replicator | |
make test | |
- name: Deploy and test sample app | |
env: | |
AWS_DEFAULT_REGION: us-east-1 | |
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }} | |
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} | |
run: | | |
cd aws-replicator/example | |
make test | |
- name: Print LocalStack logs | |
if: always() | |
run: localstack logs |