From 8cd18eed3c0b0ae10922617cf41d729720215288 Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Thu, 28 Dec 2023 11:09:05 +0100 Subject: [PATCH 1/5] add basic github action for regression testing --- .github/workflows/integration.yml | 63 +++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/integration.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..002b8eb --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,63 @@ +name: Integration test + +on: + push: + paths-ignore: + - 'README.md' + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - { python-version: '3.12', region: us-west-1, access-key-id: '000000000001'} + - { python-version: '3.12', region: us-east-1, access-key-id: 'test'} + - { python-version: '3.11', region: us-east-1, access-key-id: 'test'} + - { python-version: '3.10', region: us-east-1, access-key-id: 'test'} + - { python-version: '3.9', region: us-east-1, access-key-id: 'test'} + - { python-version: '3.8', region: us-east-1, access-key-id: 'test'} + + env: + AWS_ACCESS_KEY_ID: ${{ matrix.access-key-id }} + AWS_REGION: ${{ matrix.region }} + AWS_DEFAULT_REGION: ${{ matrix.region }} + + steps: + - uses: actions/checkout@v4 + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: '${{ matrix.python-version }}' + + - name: Install deps + run: pip install . + + - name: Install localstack CLI + run: pip install localstack + + - name: Start and wait for localstack (Community) + timeout-minutes: 10 + run: | + docker pull localstack/localstack:latest + localstack start -d + localstack wait -t 30 + + - name: Check aws-cli version + run: | + aws --version + awslocal --version + which aws + which awslocal + + - name: Verify successful deployment + run: | + awslocal lambda list-functions + awslocal ssm list-parameters From 108d82a3d30517522199598769729a6049cc4d5d Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Thu, 28 Dec 2023 11:11:00 +0100 Subject: [PATCH 2/5] fix target branch --- .github/workflows/integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 002b8eb..700cbe3 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -5,10 +5,10 @@ on: paths-ignore: - 'README.md' branches: - - main + - master pull_request: branches: - - main + - master jobs: test: From 12a03815d88fbc57b8e2f8ceeab6e77001bab361 Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Thu, 28 Dec 2023 11:15:07 +0100 Subject: [PATCH 3/5] reorder and install awscli v1 --- .github/workflows/integration.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 700cbe3..8a500c4 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -28,6 +28,7 @@ jobs: AWS_ACCESS_KEY_ID: ${{ matrix.access-key-id }} AWS_REGION: ${{ matrix.region }} AWS_DEFAULT_REGION: ${{ matrix.region }} + AWS_SECRET_ACCESS_KEY: test steps: - uses: actions/checkout@v4 @@ -38,10 +39,14 @@ jobs: python-version: '${{ matrix.python-version }}' - name: Install deps - run: pip install . + run: pip install '.[ver1]' - - name: Install localstack CLI - run: pip install localstack + - name: Check aws-cli version + run: | + aws --version + awslocal --version + which aws + which awslocal - name: Start and wait for localstack (Community) timeout-minutes: 10 @@ -49,13 +54,6 @@ jobs: docker pull localstack/localstack:latest localstack start -d localstack wait -t 30 - - - name: Check aws-cli version - run: | - aws --version - awslocal --version - which aws - which awslocal - name: Verify successful deployment run: | From 52bc31ddceef2ace124a640560486a95fbd3005c Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Thu, 28 Dec 2023 11:19:22 +0100 Subject: [PATCH 4/5] install localstack cli again --- .github/workflows/integration.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8a500c4..988f28a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -38,6 +38,9 @@ jobs: with: python-version: '${{ matrix.python-version }}' + - name: Install localstack CLI + run: pip install localstack + - name: Install deps run: pip install '.[ver1]' From b678528753f67e76356f40874b5dceebc404c5aa Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Thu, 28 Dec 2023 11:25:57 +0100 Subject: [PATCH 5/5] fix broken ssm call --- .github/workflows/integration.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 988f28a..f573571 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -58,7 +58,8 @@ jobs: localstack start -d localstack wait -t 30 - - name: Verify successful deployment + - name: Test usage of awslocal run: | awslocal lambda list-functions - awslocal ssm list-parameters + awslocal s3api list-buckets + awslocal s3 ls