69 lines
1.4 KiB
YAML
69 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
|
|
jobs:
|
|
backend:
|
|
name: Backend tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install ruff
|
|
|
|
- name: Lint backend (ruff)
|
|
continue-on-error: true
|
|
run: ruff check backend
|
|
|
|
- name: Run tests
|
|
env:
|
|
DASHSCOPE_API_KEY: test_api_key
|
|
LOG_FORMAT: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
run: python -m pytest backend/tests -q
|
|
|
|
frontend:
|
|
name: Frontend checks
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: frontend
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
cache-dependency-path: frontend/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Typecheck
|
|
continue-on-error: true
|
|
run: npm run typecheck
|
|
|
|
- name: Build
|
|
run: npm run build
|