Skip to content

Workflow file for this run

name: Код дискор бота чееееееееееееееееееееееееееееек
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: postgres
POSTGRES_USER: postgres
ports:
- 5432/tcp
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Install Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.11.3
cache-dependency-path: pyproject.toml
cache: poetry
- name: Install deps
if: steps.setup-python.outputs.cache-hit != 'true'
run: poetry install
- name: Run flake8
run: poetry run flake8
- name: Run mypy
run: poetry run mypy .
- name: Create tables of schema.sql
run: poetry run psql --set=ON_ERROR_STOP=1 --host=${{ env.POSTGRES_HOST }} --port=${{ env.POSTGRES_PORT }} --username=${{ env.POSTGRES_USER }} --dbname=${{ env.POSTGRES_DB }} --file=schema.sql --echo-errors
- name: Run tests
run: |
poetry run pytest