-
Notifications
You must be signed in to change notification settings - Fork 9
96 lines (81 loc) · 2.81 KB
/
aws-replicator.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up Terraform CLI
uses: hashicorp/setup-terraform@v2
- name: Install LocalStack and extension
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
run: |
set -e
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
. .venv/bin/activate
pip install --upgrade --pre localstack localstack-ext
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 GATEWAY_SERVER=hypercorn 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