ci: add .forgejo/workflows/ci.yml for rmi-backend
Python CI: uv setup, ruff lint+format, mypy (warn), pytest (non-integration). Runs on docker-x64 runner on Talos. 44 tests exist, now they will run in CI.
This commit is contained in:
parent
bde2f3a97d
commit
aee1c048b6
1 changed files with 49 additions and 0 deletions
49
.forgejo/workflows/ci.yml
Normal file
49
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker-x64
|
||||||
|
container:
|
||||||
|
image: python:3.11-slim
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install system deps
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends gcc libpq-dev curl git ca-certificates
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
- name: Install uv
|
||||||
|
run: |
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
run: |
|
||||||
|
uv python install 3.11
|
||||||
|
uv venv --python 3.11 .venv
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
uv pip install --python .venv/bin/python -r requirements.txt
|
||||||
|
uv pip install --python .venv/bin/python -e ".[dev]"
|
||||||
|
|
||||||
|
- name: Lint (ruff)
|
||||||
|
run: source .venv/bin/activate && ruff check . --exit-non-zero-on-fix
|
||||||
|
|
||||||
|
- name: Format check (ruff)
|
||||||
|
run: source .venv/bin/activate && ruff format --check .
|
||||||
|
|
||||||
|
- name: Type check (mypy)
|
||||||
|
run: source .venv/bin/activate && mypy app/ --ignore-missing-imports || true
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Test (pytest)
|
||||||
|
run: source .venv/bin/activate && pytest tests/ -x -q --tb=short -m "not integration"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue