Skip to content

Commit bc62150

Browse files
authored
Merge pull request #5 from ClipABit/ci-setup
feat: initial ci setup
2 parents d2937c2 + 76fda77 commit bc62150

File tree

6 files changed

+92
-8
lines changed

6 files changed

+92
-8
lines changed

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
backend:
18+
name: backend tests
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
defaults:
22+
run:
23+
working-directory: backend
24+
steps:
25+
- name: checkout
26+
uses: actions/checkout@v5
27+
28+
- name: setup uv
29+
uses: astral-sh/setup-uv@v6
30+
with:
31+
enable-cache: true
32+
cache-suffix: "backend"
33+
34+
- name: install dependencies
35+
run: uv sync --frozen
36+
37+
# TODO: tests
38+
# - name: run tests
39+
# run: uv run pytest -v
40+
41+
frontend:
42+
name: frontend tests
43+
runs-on: ubuntu-latest
44+
timeout-minutes: 10
45+
defaults:
46+
run:
47+
working-directory: frontend/web
48+
steps:
49+
- name: checkout
50+
uses: actions/checkout@v5
51+
52+
- name: setup uv
53+
uses: astral-sh/setup-uv@v6
54+
with:
55+
enable-cache: true
56+
cache-suffix: "frontend"
57+
58+
- name: install dependencies
59+
run: uv sync --frozen
60+
61+
# TODO: tests
62+
# - name: run tests
63+
# run: uv run pytest -v
64+
65+
lint:
66+
name: code quality
67+
runs-on: ubuntu-latest
68+
timeout-minutes: 5
69+
strategy:
70+
matrix:
71+
target:
72+
- { name: backend, path: backend }
73+
- { name: frontend, path: frontend/web }
74+
steps:
75+
- name: checkout
76+
uses: actions/checkout@v5
77+
78+
- name: setup uv
79+
uses: astral-sh/setup-uv@v6
80+
with:
81+
enable-cache: true
82+
83+
- name: install ruff
84+
run: uv tool install ruff
85+
86+
- name: lint ${{ matrix.target.name }}
87+
working-directory: ${{ matrix.target.path }}
88+
run: uv tool run ruff check .

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
venv/
33

44
__pycache__
5-
.python-version
65

76
.env
87
.env.*

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

backend/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def startup(self):
7373
@modal.method()
7474
async def process_video(self, video_bytes: bytes, filename: str, job_id: str):
7575
"""Background video processing task - runs in its own container."""
76-
import time
7776
logger.info(f"[Job {job_id}] Processing started: {filename} ({len(video_bytes)} bytes)")
7877

7978
try:

backend/preprocessing/compressor.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import logging
2-
from typing import Optional
32
import cv2
43
import numpy as np
54

6-
from models.metadata import VideoChunk
75

86
logging.basicConfig(level=logging.INFO)
97
logger = logging.getLogger(__name__)

backend/utils/uploader/text_uploader.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020
from typing import List
2121
from transformers import CLIPProcessor, CLIPModel
2222

23+
from database.pinecone_connector import PineconeConnector
24+
2325
# Setup paths to backend directory
2426
BACKEND_DIR = os.path.join(os.path.dirname(__file__), "../..")
2527
sys.path.insert(0, BACKEND_DIR)
2628

27-
from database.pinecone_connector import PineconeConnector
28-
29-
30-
# setup environment variables
29+
# Setup environment variables
3130
load_dotenv(os.path.join(BACKEND_DIR, ".env"))
3231
PINECONE_API_KEY = os.getenv("PINECONE_API_KEY")
3332
print(f"PINECONE_API_KEY: {'set' if PINECONE_API_KEY else 'not set'}")

0 commit comments

Comments
 (0)