diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000..cb7c6b7 --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,14 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main, feature] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/test-integration-localstack.yaml b/.github/workflows/test-integration-localstack.yaml new file mode 100644 index 0000000..ed5294e --- /dev/null +++ b/.github/workflows/test-integration-localstack.yaml @@ -0,0 +1,44 @@ +name: test-integration-localstack + +on: + pull_request: + branches: [master, feature] + +env: + AWS_DEFAULT_REGION: eu-west-1 + AWS_REGION: eu-west-1 + AWS_ACCESS_KEY_ID: test + AWS_SECRET_ACCESS_KEY: test + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + architecture: "x64" + - name: Install dependencies + run: | + pip install -r requirements-dev.txt + - name: Start LocalStack + run: | + pip install localstack awscli-local[ver1] + docker pull localstack/localstack + localstack start -d + + echo "Waiting for LocalStack startup..." + localstack wait -t 30 + echo "Startup complete" + - name: Deploy infrastructure + run: | + bin/deploy.sh + - name: Run integration tests against LocalStack + run: | + python -m pytest tests/integration + - name: Show localstack logs + if: always() + run: | + localstack logs diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml new file mode 100644 index 0000000..f8cb063 --- /dev/null +++ b/.github/workflows/test-unit.yaml @@ -0,0 +1,24 @@ +name: test-unit + +on: + pull_request: + branches: [master, feature] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + architecture: "x64" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + - name: Test with unittest + run: | + python -m unittest discover -s tests/unit -v diff --git a/bin/deploy.sh b/bin/deploy.sh old mode 100644 new mode 100755 diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..0b356e4 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,53 @@ +astroid==3.0.1 +awscli-local==0.21.1 +black==23.11.0 +boto3==1.29.3 +boto3-stubs==1.29.3 +botocore==1.32.3 +botocore-stubs==1.32.3.post1 +certifi==2023.11.17 +cfgv==3.4.0 +charset-normalizer==3.3.2 +click==8.1.7 +codecov==2.1.13 +commit-linter==1.0.3 +coverage==7.3.2 +dill==0.3.7 +distlib==0.3.7 +exceptiongroup==1.2.0 +filelock==3.13.1 +flake8==6.1.0 +identify==2.5.32 +idna==3.4 +iniconfig==2.0.0 +isort==5.12.0 +jmespath==1.0.1 +localstack-client==2.5 +mccabe==0.7.0 +mypy==1.7.0 +mypy-boto3==1.29.3 +mypy-boto3-dynamodb==1.29.0 +mypy-extensions==1.0.0 +nodeenv==1.8.0 +packaging==23.2 +pathspec==0.11.2 +platformdirs==3.11.0 +pluggy==1.3.0 +pre-commit==3.5.0 +pycodestyle==2.11.1 +pyflakes==3.1.0 +pylint==3.0.2 +pytest==7.4.3 +python-dateutil==2.8.2 +PyYAML==6.0.1 +requests==2.31.0 +s3transfer==0.7.0 +six==1.16.0 +tomli==2.0.1 +tomlkit==0.12.3 +types-awscrt==0.19.13 +types-requests==2.31.0.10 +types-s3transfer==0.7.0 +typing_extensions==4.8.0 +urllib3==2.0.7 +virtualenv==20.24.6