From cf4167631944bec6801cc9184dbf98ebfb7c6d24 Mon Sep 17 00:00:00 2001 From: Ihor Kalnytskyi Date: Tue, 22 Oct 2024 22:35:10 +0300 Subject: [PATCH] Add PostgreSQL 17 PostgreSQL 17 is the most recent version of the PostgreSQL database, released on September 26, 2024. It just makes sense to keep up with the upstream versions if we can, hence this patch. --- .github/workflows/ci.yml | 3 ++- README.md | 2 +- action.yml | 14 +++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd29deb..4331c3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -67,6 +67,7 @@ jobs: postgres-version: - "14" - "15" + - "16" steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index cbcd2af..e3955ae 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/action.yml b/action.yml index 1f2d22c..0a1ec6c 100644 --- a/action.yml +++ b/action.yml @@ -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" @@ -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 @@ -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