PostGIS not available
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare # Just installs PHP and dependencies
with:
token: ${{ secrets.GH_TOKEN }}
- uses: ikalnytskyi/action-setup-postgres@v7
id: postgres
- env:
PGSERVICE: ${{ steps.postgres.outputs.service-name }}
run: |
createuser username
createdb --owner username postgres_tests
psql -c "ALTER USER username WITH PASSWORD 'password'"
psql -c "ALTER USER username WITH SUPERUSER;"
- name: Run tests
env:
DB_CONNECTION: pgsql
DB_DATABASE: postgres_tests
DB_PORT: 5432
DB_USERNAME: username
DB_PASSWORD: password
run: php artisan test
It still says PDOException: SQLSTATE[42704]: Undefined object: 7 ERROR: type "geometry" does not exist which means PostGIS is not available in PostgreSQL. Any ideas how to fix this? When running CREATE EXTENSION postgis, I'm getting an error:
ERROR: extension "postgis" is not available
DETAIL: Could not open extension control file "/usr/share/postgresql/[17](https://github.com/.../.../actions/runs/12208658718/job/34061268966?pr=549#step:5:18)/extension/postgis.control": No such file or directory.
HINT: The extension must first be installed on the system where PostgreSQL is running.
Error: Process completed with exit code 1.
Thanks in advance.
Assuming ubuntu, you can just install postgresql-$VERSION-postgis-3 after you run this action:
steps:
- name: Set up PostgreSQL
id: postgres
uses: ikalnytskyi/action-setup-postgres@v7
with:
postgres-version: 17
- name: Install PostGIS
run: |
sudo apt-get install -y postgresql-17-postgis-3
This works because this action adds the postgresql repository, which includes postgis.
Hey there,
PostGIS installation is beyond the scope of this project. I neither have the experience nor the time to integrate its support in a non-intrusive way.
There's nyurik/action-setup-postgis which sets up PostGIS for you. It started as a fork of this action but now uses it under the hood. \
Ultimately, I believe the best approach to this problem is to provide a separate action that builds on top of this one.