Skip to content

Fix linter

Fix linter #313

Workflow file for this run

name: Test Python SDK
on: [ push ]
env:
APPLICATION_KEY: ${{ secrets.APPLICATION_KEY }}
APPLICATION_SECRET: ${{ secrets.APPLICATION_SECRET }}
AUTH_ORIGIN: ${{ secrets.AUTH_ORIGIN }}
CONVERSATION_ORIGIN: ${{ secrets.CONVERSATION_ORIGIN }}
DISABLE_SSL: ${{ secrets.DISABLE_SSL }}
KEY_ID: ${{ secrets.KEY_ID }}
KEY_SECRET: ${{ secrets.KEY_SECRET }}
NUMBERS_ORIGIN: ${{ secrets.NUMBERS_ORIGIN }}
PROJECT_ID: ${{ secrets.PROJECT_ID }}
SERVICE_PLAN_ID: ${{ secrets.SERVICE_PLAN_ID }}
SMS_ORIGIN: ${{ secrets.SMS_ORIGIN }}
TEMPLATES_ORIGIN: ${{ secrets.TEMPLATES_ORIGIN }}
VERIFICATION_ORIGIN: ${{ secrets.VERIFICATION_ORIGIN }}
VOICE_CALL_ID: ${{ secrets.VOICE_CALL_ID }}
VOICE_ORIGIN: ${{ secrets.VOICE_ORIGIN }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
flake8 sinch --count --max-complexity=10 --max-line-length=120 --statistics
- name: Test with Pytest
run: |
coverage run --source=. -m pytest
- name: Coverage Test Report
run: |
python -m coverage report --skip-empty
- name: Checkout sinch-sdk-mockserver repository
uses: actions/checkout@v3
with:
repository: sinch/sinch-sdk-mockserver
token: ${{ secrets.PAT_CI }}
fetch-depth: 0
path: sinch-sdk-mockserver
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start mock servers with Docker Compose
run: |
cd sinch-sdk-mockserver
docker-compose up -d
- name: Copy feature files
run: |
cp sinch-sdk-mockserver/features/numbers/numbers.feature ./tests/e2e/numbers/features/
- name: Run e2e tests
run: behave tests/e2e/