Skip to content

Merge pull request #98 from Debianov/language-feature #201

Merge pull request #98 from Debianov/language-feature

Merge pull request #98 from Debianov/language-feature #201

Workflow file for this run

name: Код дискор бота чееееееееееееееееееееееееееееек
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
POSTGRES_HOST: localhost
POSTGRES_DB: postgres
POSTGRES_USER: postgres
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
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
env:
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
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
env:
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
run: |
poetry run pytest