Skip to content

tests: add input file validation tests #18

tests: add input file validation tests

tests: add input file validation tests #18

Workflow file for this run

on:
push:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'
- 'templage.yml'
- 'samconfig.toml'
- 'requirements.txt'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: 'pip'
- name: Execute unit tests and coverage report
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run unit tests
run: python -m coverage run -m unittest -v tests/*.py
- name: Run coverage report
run: python -m coverage report -m
build-and-deploy:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
- uses: aws-actions/setup-sam@v2
with:
use-installer: true
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
# sam build
- name: Run SAM Build
run: sam build --use-container
# sam deploy
- name: Run SAM Deploy
run: sam deploy --s3-bucket ${{ secrets.AWS_BUCKET_NAME }} --no-confirm-changeset --no-fail-on-empty-changeset