Files
orion/.gitea/workflows/ci.yml
Samir Boulahtit 0437af67ec
Some checks failed
CI / ruff (push) Has been cancelled
CI / pytest (push) Has been cancelled
CI / architecture (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / audit (push) Has been cancelled
CI / docs (push) Has been cancelled
feat(merchant): extract merchant portal as first-class frontend with auth, Tailwind fixes, and Gitea CI
- Extract login/dashboard from billing module into core (matching admin pattern)
- Add merchant auth API with path-isolated cookies (path=/merchants)
- Add merchant base layout with sidebar/header partials and Alpine.js init
- Add frontend detection and login redirect for MERCHANT type
- Wire merchant token in shared api-client.js (get/clear)
- Migrate billing templates to merchant base with dark mode support
- Fix Tailwind: rename shop→storefront in sources and config
- DRY Makefile tailwind targets with TAILWIND_FRONTENDS loop
- Rebuild all Tailwind outputs (production minified)
- Add Gitea Actions CI workflow (ruff, pytest, architecture, docs)
- Add Gitea deployment documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:25:29 +01:00

176 lines
4.5 KiB
YAML

# Gitea Actions CI/CD Configuration
# ==================================
# Equivalent of the GitLab CI pipeline, using GitHub Actions-compatible syntax.
# 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 sync --frozen
- name: Run ruff
run: .venv/bin/ruff check .
# ---------------------------------------------------------------------------
# Tests
# ---------------------------------------------------------------------------
pytest:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: wizamart_test
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U test_user -d wizamart_test"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
TEST_DATABASE_URL: "postgresql://test_user:test_password@localhost:5432/wizamart_test"
DATABASE_URL: "postgresql://test_user:test_password@localhost:5432/wizamart_test"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache pip & venv
uses: actions/cache@v4
with:
path: |
~/.cache/pip
.venv
key: ${{ runner.os }}-pip-${{ hashFiles('uv.lock', 'pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install uv
run: pip install uv
- name: Install dependencies
run: uv sync --frozen
- name: Run tests
run: .venv/bin/python -m pytest tests/ -v --tb=short
architecture:
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 sync --frozen
- name: Validate architecture
run: .venv/bin/python scripts/validate/validate_architecture.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
audit:
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 uv
run: pip install uv
- name: Install dependencies
run: uv sync --frozen
- name: Run audit
run: .venv/bin/python scripts/validate/validate_audit.py
# ---------------------------------------------------------------------------
# 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, architecture]
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 sync --frozen
- name: Build docs
run: .venv/bin/mkdocs build
- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
name: docs-site
path: site/