Skip to content

General testing

General testing #407

Workflow file for this run

name: Python CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
directory: ['./amplify/backend/function/getBlogContent/', './amplify/backend/function/stepFunctionInvoker/', './amplify/backend/function/storingTranslation/']
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
working-directory: ${{ matrix.directory }}
run: |
python -m pip install --upgrade pip
pip install flake8 pytest botocore boto3
if [ -f Requirements.txt ]; then pip install -r Requirements.txt; fi
- name: Set AWS region
run: |
echo "AWS_DEFAULT_REGION=eu-west-1" >> $GITHUB_ENV
- name: Lint with flake8
working-directory: ${{ matrix.directory }}
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
if: matrix.directory != './amplify/backend/function/getBlogContent/'
working-directory: ${{ matrix.directory }}
run: |
pytest
- name: Test with unittest
if: matrix.directory == './amplify/backend/function/getBlogContent/'
working-directory: ${{ matrix.directory }}
run: |
python -m unittest discover -s tests