46 lines
951 B
YAML
46 lines
951 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
lint-and-test:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./backend
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
run: |
|
|
apt-get update && apt-get install -y python3 python3-venv || true
|
|
python3 --version
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python3 -m venv .venv
|
|
source .venv/bin/activate
|
|
pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
|
|
- name: Lint with ruff
|
|
run: |
|
|
source .venv/bin/activate
|
|
ruff check .
|
|
|
|
- name: Format check with ruff
|
|
run: |
|
|
source .venv/bin/activate
|
|
ruff format --check .
|
|
|
|
- name: Run tests
|
|
run: |
|
|
source .venv/bin/activate
|
|
pytest -q
|