Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: fix workflows
Browse files Browse the repository at this point in the history
Ramimashkouk committed Apr 15, 2024
1 parent 3cb2f52 commit 07e4e5d
Showing 12 changed files with 86 additions and 154 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/backend_check.yml
Original file line number Diff line number Diff line change
@@ -11,13 +11,13 @@ jobs:
- name: set up python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.10
python-version: '3.10'

- name: setup poetry and install dependencies
run: |
python -m pip install --upgrade pip poetry
python -m poetry lock --no-update
python -m poetry install --with lint --quiet --no-interaction
python -m poetry install --with lint --no-interaction
working-directory: backend/df_designer

- name: build wheel
@@ -27,8 +27,8 @@ jobs:

- name: run black codestyle
run: |
black --line-length=120 --check .
working-directory: backend
python -m poetry run black --line-length=120 --check .
working-directory: backend/df_designer

- name: run flake8 codestyle
run: |
@@ -39,5 +39,5 @@ jobs:

- name: run isort codestyle
run: |
isort --line-length=120 --diff .
working-directory: backend
python -m poetry run isort --line-length=120 --diff .
working-directory: backend/df_designer
29 changes: 3 additions & 26 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ jobs:
- name: set up python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.10
python-version: '3.10'

- name: setup poetry and install dependencies
run: |
@@ -22,34 +22,11 @@ jobs:

- name: run black codestyle
run: |
black --line-length=120 --check .
working-directory: backend
python -m poetry run black --line-length=120 --check .
working-directory: backend/df_designer

- name: run flake8 codestyle
run: |
bash ./bin/run_codestyle.sh DIFF_BRANCH=${BASE_BRANCH}
env:
BASE_BRANCH: ${{github.base_ref}}

- name: run isort codestyle
run: |
isort --line-length=120 --diff .
working-directory: backend

check_frontend_codestyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Base image
uses: oven-actions/docker-run@v1
with:
image: oven/bun:1
name: frontend-base
command: bun install
working-directory: frontend
- name: run type checking
uses: oven-actions/docker-run@v1
with:
image: frontend-base
command: bun run check
working-directory: frontend
9 changes: 8 additions & 1 deletion .github/workflows/docker_check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Build Docker Images

on: [push, pull_request]
on:
push:
branches:
- dev
pull_request:
branches:
- dev

jobs:
build_images:
@@ -11,6 +17,7 @@ jobs:
- name: setup poetry and install dependencies
run: |
python -m pip install --upgrade pip poetry
python -m poetry lock --no-update
python -m poetry install --with lint --no-ansi --no-interaction
working-directory: backend/df_designer

29 changes: 9 additions & 20 deletions .github/workflows/frontend_check.yml
Original file line number Diff line number Diff line change
@@ -3,29 +3,18 @@ name: front check
on: [push, pull_request]

jobs:
build_images:
build_and_check_frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Base image
uses: oven-actions/docker-run@v1
with:
image: oven/bun:1
name: frontend-base
command: bun install
working-directory: frontend
- name: Install bun
run: npm install -g bun

- name: build project
uses: oven-actions/docker-run@v1
with:
image: frontend-base
command: bun run build
working-directory: frontend
- name: Install dependencies
run: bun install
working-directory: frontend

- name: run type checking
uses: oven-actions/docker-run@v1
with:
image: frontend-base
command: bun run check
working-directory: frontend
- name: Build frontend
run: bun run build
working-directory: frontend
6 changes: 5 additions & 1 deletion backend/df_designer/app/cli.py
Original file line number Diff line number Diff line change
@@ -105,6 +105,10 @@ def init(destination: str = settings.work_directory, no_input: bool = False, ove
original_dir = os.getcwd()
try:
os.chdir(destination)
cookiecutter("https://github.com/Ramimashkouk/df_d_template.git", no_input=no_input, overwrite_if_exists=overwrite_if_exists)
cookiecutter(
"https://github.com/Ramimashkouk/df_d_template.git",
no_input=no_input,
overwrite_if_exists=overwrite_if_exists,
)
finally:
os.chdir(original_dir)
1 change: 0 additions & 1 deletion backend/df_designer/app/core/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pathlib import Path

import uvicorn
from omegaconf import OmegaConf
from pydantic_settings import BaseSettings


1 change: 0 additions & 1 deletion backend/df_designer/app/services/process.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
from typing import List

import aiofiles
from omegaconf import OmegaConf

from app.core.config import settings
from app.core.logger_config import get_logger, setup_logging
2 changes: 1 addition & 1 deletion backend/df_designer/app/services/process_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
from typing import List, Optional, Type
from typing import List

from omegaconf import OmegaConf

4 changes: 2 additions & 2 deletions backend/df_designer/app/services/websocket_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
from asyncio.tasks import Task
from typing import Dict, Optional, Set
from typing import Dict, Set

from fastapi import WebSocket, WebSocketDisconnect

@@ -29,7 +29,7 @@ def disconnect(self, websocket: WebSocket):

def check_status(self, websocket: WebSocket):
if websocket in self.active_connections:
return websocket ## return Status!
return websocket # return Status!

async def send_process_output_to_websocket(
self, run_id: int, process_manager: ProcessManager, websocket: WebSocket
143 changes: 50 additions & 93 deletions backend/df_designer/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/df_designer/pyproject.toml
Original file line number Diff line number Diff line change
@@ -26,5 +26,5 @@ optional = true

[tool.poetry.group.lint.dependencies]
isort = "^5"
black = "^18"
black = "^22"
flake8 = "^4"
Loading

0 comments on commit 07e4e5d

Please sign in to comment.