Skip to content

Create LICENSE

Create LICENSE #2

name: Python Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
container: python:3.8-slim
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
env:
AWS_DEFAULT_REGION: ap-southeast-1
run: |
coverage run -m unittest discover
coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Deploy with cloudformation
env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws cloudformation package --template-file template.yml --output-template-file serverless-output.yaml --s3-bucket ${{ secrets.AWS_S3_BUCKET }}
aws cloudformation deploy --template-file serverless-output.yaml --stack-name ${{ secrets.STACK_NAME }} --capabilities CAPABILITY_NAMED_IAM --no-execute-changeset