ci: add workflow for lint, type check and tests
This commit is contained in:
1 parent
bf9f424200
commit
69b62b9f0b
3 files changed
+71
No files matched your search
@@ -0,0 +1,54 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
python:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
- name: Install backend and bot packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e "backend[dev]" -e "bot[dev]"
|
||||
- name: Lint (ruff)
|
||||
run: ruff check backend bot
|
||||
- name: Type check (mypy)
|
||||
run: mypy --config-file backend/pyproject.toml backend/sokhan
|
||||
- name: Tests
|
||||
env:
|
||||
CELERY_ENABLED: "false"
|
||||
DATA_DIR: /tmp/sokhan-ci-data
|
||||
run: pytest -m "not gpu_optional"
|
||||
|
||||
web:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ hashFiles('web/package.json') != '' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
cache-dependency-path: web/package-lock.json
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: web
|
||||
- name: Build
|
||||
run: npm run build
|
||||
working-directory: web
|
||||
|
||||
compose:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ hashFiles('deploy/docker-compose.yml') != '' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Validate compose file
|
||||
run: docker compose -f deploy/docker-compose.yml config -q
|
||||
@@ -0,0 +1,6 @@
|
||||
[pytest]
|
||||
testpaths = backend/tests bot/tests
|
||||
markers =
|
||||
gpu_optional: requires the real Whisper model and network access; skipped in CI
|
||||
filterwarnings =
|
||||
ignore::DeprecationWarning
|
||||
Reference in new issue
Block a user