ci: enable github actions

This commit is contained in:
Felix Spöttel
2023-02-08 14:15:50 +01:00
parent 18921d34c6
commit 27d8ba743e
4 changed files with 27 additions and 24 deletions

View File

@@ -9,13 +9,14 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.10'
cache: 'pip'
- pip install -e .[dev]
- black --check app
- isort --check app
- flake8 app
- mypy app
cache-dependency-path: '**/pyproject.toml'
- run: pip install -e .[web,tooling]
- run: black --check app
- run: isort --check app
- run: flake8 app
- run: mypy app
test:
runs-on: ubuntu-latest
name: Test
@@ -23,7 +24,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.10'
cache: 'pip'
- pip install -e .[test]
- pytest
cache-dependency-path: '**/pyproject.toml'
- run: pip install -e .[web,tooling]
- run: pytest

View File

@@ -7,10 +7,11 @@ from sqlalchemy.orm import Session
import app.shared.db.dtos as dtos
import app.shared.db.models as models
from app.shared.db.dtos import JobStatus, JobType
from app.web.main import app, celery
from app.web.main import app
client = TestClient(app)
@pytest.fixture(name="mock_job", scope="function", autouse=False)
def mock_job(db_session: Session) -> models.Job:
job = models.Job(

View File

@@ -1,4 +1,4 @@
[mypy]
plugins = pydantic.mypy, sqlmypy
plugins = sqlmypy
ignore_missing_imports = True
disallow_untyped_defs = True

View File

@@ -1,5 +1,5 @@
[project]
name = "whisperbox"
name = "whisperbox_transcription"
description = ""
version = "0.0.1"
@@ -21,25 +21,25 @@ worker=[
"requests ==2.28.2"
]
lint = [
tooling = [
# code formatting
"black",
"isort",
"black ==23.1.0",
"isort ==5.12.0",
# linting
"flake8",
"mypy",
]
test = [
"flake8 ==6.0.0",
# tests
"httpx",
"sqlalchemy-stubs",
"sqlalchemy-utils ==0.39.0",
"python-dotenv",
"pytest",
"python-dotenv ==0.21.1",
"pytest ==7.2.1",
# types
"mypy ==1.0.0",
"sqlalchemy-stubs ==0.4",
"types-requests ==2.28.11.12"
]
worker_dev = [
"watchdog[watchmedo]"
"watchdog[watchmedo] ==2.2.1"
]
[tool.isort]