Skip to content

fix: Изменения, которые будут включены в коммит: #2

fix: Изменения, которые будут включены в коммит:

fix: Изменения, которые будут включены в коммит: #2

Workflow file for this run

name: Run tests for homework
on: [push]
jobs:
homework-tests:
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: secretpassword
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest Faker requests pytest-asyncio
- name: Install inner (homework-level) dependencies
run: |
for d in homework_* ; do
HW_REQUIREMENTS_PATH="$d/requirements.txt"
if [ -f "$HW_REQUIREMENTS_PATH" ];
then
echo file \'"$HW_REQUIREMENTS_PATH"\' exists, installing...
pip install -r "$HW_REQUIREMENTS_PATH";
fi
done
- name: Install project-level dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest testing -s -vv -rsx
env:
SQLALCHEMY_PG_CONN_URI: postgresql+asyncpg://postgres:secretpassword@localhost:5432/postgres