ci(fusion_accounting): add CI workflow scaffold + Phase 0 deferral note
Workflow structure is complete (path filters, matrix, services). The 'Install Odoo 19' step is a TODO placeholder — the reproducible Odoo-19 build environment is deferred to Phase 1 CI hardening. Current Phase 0 test workflow is manual via ssh odoo-westin. Made-with: Cursor
This commit is contained in:
79
.gitea/workflows/fusion_accounting_ci.yml
Normal file
79
.gitea/workflows/fusion_accounting_ci.yml
Normal file
@@ -0,0 +1,79 @@
|
||||
name: fusion_accounting CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'fusion_accounting/**'
|
||||
- 'fusion_accounting_core/**'
|
||||
- 'fusion_accounting_ai/**'
|
||||
- 'fusion_accounting_migration/**'
|
||||
- '.gitea/workflows/fusion_accounting_ci.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'fusion_accounting/**'
|
||||
- 'fusion_accounting_core/**'
|
||||
- 'fusion_accounting_ai/**'
|
||||
- 'fusion_accounting_migration/**'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
# NOTE: This workflow assumes a self-hosted runner (or Docker-in-Docker)
|
||||
# that provides an Odoo 19 install. Adjust the `runs-on` and
|
||||
# `Install Odoo 19` step to match Nexa's environment.
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:15
|
||||
env:
|
||||
POSTGRES_USER: odoo
|
||||
POSTGRES_PASSWORD: odoo
|
||||
POSTGRES_DB: postgres
|
||||
ports: ['5432:5432']
|
||||
options: --health-cmd pg_isready --health-interval 10s
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sub_module:
|
||||
- fusion_accounting_core
|
||||
- fusion_accounting_ai
|
||||
- fusion_accounting_migration
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python 3.11
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install AI client deps
|
||||
run: |
|
||||
pip install --break-system-packages anthropic openai
|
||||
|
||||
- name: Install Odoo 19
|
||||
run: |
|
||||
# TODO(Phase 1 CI hardening): align with Nexa's Odoo 19 source-of-truth.
|
||||
# Option A: pull the same image used at odoo-westin (docker pull <registry>/odoo:19)
|
||||
# Option B: odoo-bin pip install from the pinned Odoo 19 tag
|
||||
# Option C: host a self-hosted runner on odoo-westin with Odoo pre-installed
|
||||
echo "TODO: install Odoo 19 here"
|
||||
exit 1 # fail loudly until this step is implemented
|
||||
|
||||
- name: Stage fusion sub-modules in addons-path
|
||||
run: |
|
||||
mkdir -p /tmp/addons
|
||||
cp -r fusion_accounting fusion_accounting_core fusion_accounting_ai fusion_accounting_migration /tmp/addons/
|
||||
|
||||
- name: Install + Test ${{ matrix.sub_module }}
|
||||
run: |
|
||||
createdb -h localhost -U odoo fusion_test_${{ matrix.sub_module }}
|
||||
odoo --addons-path=/tmp/addons \
|
||||
-d fusion_test_${{ matrix.sub_module }} \
|
||||
-i ${{ matrix.sub_module }} \
|
||||
--test-tags post_install \
|
||||
--stop-after-init \
|
||||
--without-demo=all \
|
||||
--log-handler=odoo.tests:INFO
|
||||
env:
|
||||
PGPASSWORD: odoo
|
||||
@@ -0,0 +1,41 @@
|
||||
# CI Currently Manual (Phase 0 note)
|
||||
|
||||
The CI yaml at `.gitea/workflows/fusion_accounting_ci.yml` (or `.github/`)
|
||||
describes the target workflow, but the `Install Odoo 19` step is a TODO
|
||||
placeholder in Phase 0 because the repo does not yet pin a reproducible
|
||||
Odoo 19 build environment for CI runners.
|
||||
|
||||
## Current workflow (Phase 0)
|
||||
|
||||
Tests are run manually via the dev server:
|
||||
|
||||
ssh odoo-westin "docker exec odoo-dev-app odoo -d westin-v19 \
|
||||
--test-tags post_install --stop-after-init --no-http \
|
||||
-c /etc/odoo/odoo.conf -u <sub_module> \
|
||||
--log-handler=odoo.tests:INFO"
|
||||
|
||||
This pattern is embedded in the Phase 0 plan's per-task verification steps.
|
||||
|
||||
## To activate CI (deferred to Phase 1)
|
||||
|
||||
Three realistic approaches:
|
||||
|
||||
1. **Dockerfile + DinD**: Build a reproducible Odoo-19 image in the repo
|
||||
(e.g. `docker/odoo-19.Dockerfile`). CI runner uses Docker-in-Docker.
|
||||
Slowest to boot, fully reproducible.
|
||||
2. **Self-hosted runner on odoo-westin**: Register a runner on the existing
|
||||
dev box. Tests run against a throwaway DB (per-CI-run). Fastest; ties
|
||||
CI to odoo-westin availability.
|
||||
3. **Pip-installable Odoo**: `pip install odoo==19.0.*` (if Odoo publishes
|
||||
wheels that match the Enterprise-aware build). Simplest if it works.
|
||||
|
||||
Pick when Phase 1 (Bank Reconciliation) begins — Phase 1 benefits from
|
||||
automated test runs because its scope is broader than Phase 0's.
|
||||
|
||||
## What the current yaml gets right
|
||||
|
||||
- Path filters only trigger on fusion_accounting* changes
|
||||
- Matrix tests each sub-module independently
|
||||
- Python deps (anthropic, openai) preinstalled
|
||||
- PostgreSQL 15 service wired
|
||||
- Odoo stdout/stderr captured at INFO level to see test results
|
||||
Reference in New Issue
Block a user