Skip to content

Commit

Permalink
Merge pull request #47 from ikalnytskyi/feat/postgres-17
Browse files Browse the repository at this point in the history
Add PostgreSQL 17
  • Loading branch information
ikalnytskyi authored Oct 24, 2024
2 parents 32cbb0b + cf41676 commit 3f8cb23
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
CERTIFICATE_PATH: ${{ steps.postgres.outputs.certificate-path }}
EXPECTED_CONNECTION_URI: postgresql://postgres:postgres@localhost:5432/postgres
EXPECTED_SERVICE_NAME: postgres
EXPECTED_SERVER_VERSION: "16"
EXPECTED_SERVER_VERSION: "17"
EXPECTED_SSL: false

parametrized:
Expand All @@ -67,6 +67,7 @@ jobs:
postgres-version:
- "14"
- "15"
- "16"
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ key features:
| password | The password of the user to setup. | `postgres` |
| database | The database name to setup and grant permissions to created user. | `postgres` |
| port | The server port to listen on. | `5432` |
| postgres-version | The PostgreSQL major version to install. Supported values: "14", "15", "16". | `16` |
| postgres-version | The PostgreSQL major version to install. Supported values: "14", "15", "16", "17". | `17` |

#### Outputs

Expand Down
14 changes: 9 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ inputs:
default: "5432"
required: false
postgres-version:
description: The PostgreSQL major version to install. Either "14", "15", or "16".
default: "16"
description: The PostgreSQL major version to install. Either "14", "15", "16" or "17".
default: "17"
ssl:
description: When "true", encrypt connections using SSL (TLS).
default: "false"
Expand All @@ -43,8 +43,8 @@ runs:
steps:
- name: Install PostgreSQL
run: |
if [[ ! "${{ inputs.postgres-version }}" =~ ^(14|15|16)$ ]]; then
echo "::error::postgres-version must be one of: 14, 15, 16."
if [[ ! "${{ inputs.postgres-version }}" =~ ^(14|15|16|17)$ ]]; then
echo "::error::postgres-version must be one of: 14, 15, 16, 17."
exit 1
fi
Expand Down Expand Up @@ -82,11 +82,15 @@ runs:
echo "PQ_LIB_DIR=$PG_LIBDIR" >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "macOS" ]; then
# HOMEBREW_GITHUB_ACTIONS is used to skip 'initdb' execution to save
# some seconds. That invocation is not needed because of initdb
# invocation below.
export HOMEBREW_GITHUB_ACTIONS=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
export HOMEBREW_NO_INSTALL_UPGRADE=1
brew install --quiet --skip-post-install postgresql@${{ inputs.postgres-version }}
brew install --quiet postgresql@${{ inputs.postgres-version }}
# Link PostgreSQL binaries from /usr/local/bin in order to make them
# available globally. The --overwrite option is required since some
Expand Down

0 comments on commit 3f8cb23

Please sign in to comment.