diff --git a/copier.yml b/copier.yml index 226a00d7..024b4814 100644 --- a/copier.yml +++ b/copier.yml @@ -114,6 +114,18 @@ include_wkhtmltopdf: Do you need to install wkhtmltopdf? Usually only needed if you're going to test PDF report generation. +postgis_extension: + type: bool + default: no + when: "{{ odoo_version >= 16 }}" + help: + Does this repo install Odoo modules that require the PostGIS extension + (geo_* field types, wkb_geometry columns, base_geoengine, etc.)? + When yes, the CI postgres service uses a postgis/postgis:- + image so pre_init_hook CREATE EXTENSION postgis succeeds. Recommended + for OCA/geospatial and any repo with geo fields. Available for + odoo_version >= 16.0 (postgis/postgis:9.6-* tags are EOL). + enable_checklog_odoo: type: bool default: "{% if odoo_version < 18.0 -%}no{% else %}yes{% endif %}" diff --git a/src/.github/workflows/test.yml.jinja b/src/.github/workflows/test.yml.jinja index abeb531c..9c5524ca 100644 --- a/src/.github/workflows/test.yml.jinja +++ b/src/.github/workflows/test.yml.jinja @@ -121,6 +121,23 @@ jobs: {%- endif %} services: postgres: + {%- if postgis_extension and odoo_version >= 16 %} + # PostGIS image variants ship the spatial extension preinstalled so + # modules with geo_* fields can `CREATE EXTENSION postgis` in their + # pre_init_hook. Image tags chosen to match the OCA/geospatial + # baseline on each Odoo series: + # 16-18 -> postgis/postgis:13-3.4 (already ships on OCA/geospatial + # 17.0 + 18.0 branches) + # >= 19 -> postgis/postgis:14-3.5 (matches OCA/geospatial PR #446) + # Both PG versions are within Odoo's documented PG support window. + # Flag is gated to odoo_version >= 16 because postgis/postgis:9.6-* + # tags are EOL and not maintained. + {%- if odoo_version < 19 %} + image: postgis/postgis:13-3.4 + {%- else %} + image: postgis/postgis:14-3.5 + {%- endif %} + {%- else %} {%- if odoo_version < 16 %} image: postgres:9.6 {%- elif odoo_version < 19 %} @@ -128,6 +145,7 @@ jobs: {%- else %} image: postgres:13 {%- endif %} + {%- endif %} env: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo