Files
orion/.gitea/workflows/ci.yml
Samir Boulahtit b382090771
Some checks failed
CI / ruff (push) Successful in 12s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
refactor: remove GitLab CI config and docs after full Gitea migration
- Delete .gitlab-ci.yml (replaced by .gitea/workflows/ci.yml)
- Delete docs/deployment/gitlab.md (superseded by gitea.md)
- Update audit rules to reference .gitea/workflows/*.yml
- Update validate_audit.py to check Gitea CI paths
- Clean up GitLab references in gitea.md, mkdocs.yml, .dockerignore
- Mark IPv6 AAAA records as completed in hetzner docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 19:28:35 +01:00

159 lines
4.6 KiB
YAML

# Gitea Actions CI/CD Configuration
# ==================================
# Uses GitHub Actions-compatible syntax. Requires Gitea 1.19+ with Actions enabled.
# Requires Gitea 1.19+ with Actions enabled.
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
PYTHON_VERSION: "3.11"
jobs:
# ---------------------------------------------------------------------------
# Lint
# ---------------------------------------------------------------------------
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
run: pip install uv
- name: Install dependencies
run: uv pip install --system -r requirements.txt -r requirements-dev.txt
- name: Run ruff
run: ruff check .
# ---------------------------------------------------------------------------
# Tests
# ---------------------------------------------------------------------------
pytest:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: orion_test
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
options: >-
--health-cmd "pg_isready -U test_user -d orion_test"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# act_runner executes jobs in Docker containers on the same network as services,
# so use the service name (postgres) as hostname with the internal port (5432)
TEST_DATABASE_URL: "postgresql://test_user:test_password@postgres:5432/orion_test"
DATABASE_URL: "postgresql://test_user:test_password@postgres:5432/orion_test"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
run: pip install uv
- name: Install dependencies
run: uv pip install --system -r requirements.txt -r requirements-test.txt
- name: Run tests
run: python -m pytest tests/ -v --tb=short
validate:
runs-on: ubuntu-latest
env:
DATABASE_URL: "postgresql://dummy:dummy@localhost:5432/dummy"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
run: pip install uv
- name: Install dependencies
run: uv pip install --system -r requirements.txt
- name: Run all validators
run: python scripts/validate/validate_all.py
# ---------------------------------------------------------------------------
# Security (non-blocking)
# ---------------------------------------------------------------------------
dependency-scanning:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install pip-audit
run: pip install pip-audit
- name: Run pip-audit
run: pip-audit --requirement requirements.txt || true
# ---------------------------------------------------------------------------
# Build (docs - only on push to master)
# ---------------------------------------------------------------------------
docs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [ruff, pytest, validate]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
run: pip install uv
- name: Install dependencies
run: uv pip install --system -r requirements.txt -r requirements-docs.txt
- name: Build docs
run: mkdocs build
# ---------------------------------------------------------------------------
# Deploy (master-only, after lint + tests + validate pass)
# ---------------------------------------------------------------------------
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [ruff, pytest, validate]
steps:
- name: Deploy to production
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
port: 22
command_timeout: 10m
script: cd ${{ secrets.DEPLOY_PATH }} && bash scripts/deploy.sh