Skip to content

Commit 323cd84

Browse files
committed
Enhance PostgreSQL setup with comprehensive PostGIS support
- Set PostgreSQL 17 as default version with macOS compatibility - Add comprehensive input parameters (schema import, ODBC, search path, extensions) - Implement dynamic port resolution for ARM64 Linux runners - Add preflight checks and version validation - Support additional PostgreSQL extensions installation - Add database schema import functionality - Configure ODBC drivers for all platforms - Update documentation to match all available features - Enhance CI workflow with expanded OS version testing
1 parent 651ee6d commit 323cd84

File tree

3 files changed

+260
-22
lines changed

3 files changed

+260
-22
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
env:
5555
PGSERVICE: ${{ steps.postgres.outputs.service-name }}
5656

57-
5857
parametrized:
5958
runs-on: ${{ matrix.os }}
6059
strategy:

README.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# setup-postgis
22

3-
[![GitHub](https://img.shields.io/badge/github-nyurik/action--setup--postgis-8da0cb?logo=github)](https://github.com/nyurik/action-setup-postgis)
4-
[![CI build](https://github.com/nyurik/action-setup-postgis/actions/workflows/ci.yml/badge.svg)](https://github.com/nyurik/action-setup-postgis/actions)
3+
[![GitHub](https://img.shields.io/badge/github-nyurik/action--setup--postgis-8da0cb?logo=github)](https://github.com/OpenGov/action-setup-postgis)
4+
[![CI build](https://github.com/nyurik/action-setup-postgis/actions/workflows/ci.yml/badge.svg)](https://github.com/OpenGov/action-setup-postgis/actions)
55
[![Marketplace](https://img.shields.io/badge/market-setup--postgis-6F42C1?logo=github)](https://github.com/marketplace/actions/setup-postgresql-and-postgis-for-linux-macos-windows)
66

77
> [!TIP]
@@ -13,6 +13,7 @@
1313
* Linux version is installed from the [PostGIS apt repository](https://postgis.net/install/).
1414
* Windows version is installed from the [OSGeo](https://download.osgeo.org/postgis/windows/).
1515
* MacOS version is installed using [Homebrew package](https://formulae.brew.sh/formula/postgis).
16+
* MacOS only supports Postgres 14 and Postgres 17.
1617

1718
See also [action-setup-nginx](https://github.com/nyurik/action-setup-nginx) to configure NGINX service.
1819

@@ -31,22 +32,29 @@ steps:
3132
3233
#### Input parameters
3334
34-
| Key | Value | Default |
35-
|------------------|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
36-
| username | The username of the user to setup. | `postgres` |
37-
| password | The password of the user to setup. | `postgres` |
38-
| database | The database name to setup and grant permissions to created user. | `postgres` |
39-
| port | The server port to listen on. | `5432` |
40-
| postgres-version | The PostgreSQL version to install. | `17` |
41-
| postgis_version | **(Windows only)** The PostGIS version to installed. | By default (empty), will use the latest. See available versions [here](https://download.osgeo.org/postgis/windows/). If set, must use the entire version string like `3.3.3` |
42-
| cached-dir | Where should the temporary downloads be placed. Used to download and cache PostGIS binary. | `downloads` |
35+
| Key | Value | Default |
36+
|-------------------------|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
37+
| username | The username of the user to setup. | `postgres` |
38+
| password | The password of the user to setup. | `postgres` |
39+
| database | The database name to setup and grant permissions to created user. | `postgres` |
40+
| port | The server port to listen on. ARM64 runner collide on 5432 | `5432` |
41+
| postgres-version | The PostgreSQL version to install. MacOS only supports 14 and 17 | `17` |
42+
| postgis_version | The PostGIS version to install. | By default (empty), will use the latest. See available versions [here](https://download.osgeo.org/postgis/windows/). If set, must use the entire version string like `3.3.3` |
43+
| cached-dir | Where should the temporary downloads be placed. Used to download and cache PostGIS binary. | `${{ runner.temp }}/setup-postgis-downloads` |
44+
| import-schema | Import database schema. | `false` |
45+
| schema-file | Path to the SQL schema file to import (relative to workspace or absolute path). | `""` (empty) |
46+
| setup-odbc | Configure ODBC drivers. | `false` |
47+
| search-path | Default schema search path for database and user. | `""` (empty) |
48+
| additional-extensions | Comma-separated list of additional PostgreSQL extensions to install (beyond PostGIS). | `""` (empty) |
4349

4450
#### Outputs
4551

46-
| Key | Description | Example |
47-
|----------------|----------------------------------------------|-----------------------------------------------------|
48-
| connection-uri | The connection URI to connect to PostgreSQL. | `postgresql://postgres:postgres@localhost/postgres` |
49-
| service-name | The service name with connection parameters. | `postgres` |
52+
| Key | Description | Example |
53+
|----------------------------|--------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
54+
| connection-uri | The connection URI to connect to PostgreSQL. | `postgresql://postgres:postgres@localhost/postgres` |
55+
| service-name | The service name with connection parameters. | `postgres` |
56+
| npgsql-connection-string | Npgsql connection string with search path. | `Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=postgres;Search Path=;` |
57+
| odbc-connection-string | ODBC connection string. | `Driver={PostgreSQL ANSI};Servername=localhost;Port=5432;Database=postgres;Username=postgres;Password=postgres;` |
5058

5159
#### User permissions
5260

0 commit comments

Comments
 (0)