Skip to content

Commit

Permalink
add ci (#22)
Browse files Browse the repository at this point in the history
* add ci
  • Loading branch information
lesnik512 committed Apr 29, 2024
1 parent 19b4856 commit 278c657
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- run: |
pip install -U pip poetry
poetry install --sync --no-root
poetry run ruff format . --check
poetry run ruff check . --no-fix
poetry run mypy .
pytest:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- run: |
pip install -U pip poetry
poetry install --sync --no-root
poetry run alembic upgrade head
poetry run pytest
env:
ENVIRONMENT: dev
PYTHONDONTWRITEBYTECODE: 1
PYTHONUNBUFFERED: 1
DB_HOST: 127.0.0.1

0 comments on commit 278c657

Please sign in to comment.