Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:<pg>-<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 %}"
Expand Down
18 changes: 18 additions & 0 deletions src/.github/workflows/test.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,31 @@ 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 %}
image: postgres:12
{%- else %}
image: postgres:13
{%- endif %}
{%- endif %}
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
Expand Down
Loading