add gitea ci workflow

This commit is contained in:
Username
2025-12-20 03:31:43 +01:00
parent 4cb29fa3d2
commit a07f1e662e

34
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,34 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
container:
image: debian:bookworm-slim
steps:
- name: Checkout
run: |
apt-get update && apt-get install -y --no-install-recommends git ca-certificates
git clone --depth 1 --branch "${GITHUB_REF_NAME}" \
"https://oauth2:${{ github.token }}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
- name: Install dependencies
run: |
apt-get install -y --no-install-recommends python3 python3-pip python3-venv
python3 -m venv venv
./venv/bin/pip install --quiet --upgrade pip
./venv/bin/pip install --quiet -r requirements.txt
./venv/bin/pip install --quiet pytest pytest-cov
- name: Run tests
run: ./venv/bin/pytest tests/ -v --tb=short
- name: Check syntax
run: ./venv/bin/python -m py_compile run.py wsgi.py app/*.py app/**/*.py