diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 133e92f0..e9dbd200 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,11 +61,3 @@ jobs: run: | go install github.com/mattn/goveralls@latest goveralls -service=github -coverprofile=build/cover.out - services: - postgres: - image: postgres:17 - env: - POSTGRES_PASSWORD: postgres - ports: - - 54321:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 diff --git a/testing/with-postgres-db.sh b/testing/with-postgres-db.sh deleted file mode 100755 index 3c370c83..000000000 --- a/testing/with-postgres-db.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -# Copyright 2022 SAP SE -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -# shellcheck shell=ash -set -euo pipefail - -# Darwin compatibility -if hash greadlink >/dev/null 2>/dev/null; then - readlink() { greadlink "$@"; } -fi - -# set working directory to repo root -cd "$(dirname "$(dirname "$(readlink -f "$0")")")" - -step() { - printf '\x1B[1;36m>>\x1B[0;36m %s...\x1B[0m\n' "$1" -} - -if [ ! -d testing/postgresql-data/ ]; then - step "First-time setup: Creating PostgreSQL database for testing" - initdb -A trust -U postgres testing/postgresql-data/ -fi -mkdir -p testing/postgresql-run/ - -step "Configuring PostgreSQL" -sed -ie '/^#\?\(external_pid_file\|unix_socket_directories\|port\)\b/d' testing/postgresql-data/postgresql.conf -( - echo "external_pid_file = '${PWD}/testing/postgresql-run/pid'" - echo "unix_socket_directories = '${PWD}/testing/postgresql-run'" - echo "port = 54321" -) >> testing/postgresql-data/postgresql.conf - -# usage in trap is not recognized -# shellcheck disable=SC2317 -stop_postgres() { - EXIT_CODE=$? - step "Stopping PostgreSQL" - pg_ctl stop -D testing/postgresql-data/ -w -s - exit "${EXIT_CODE}" -} - -step "Starting PostgreSQL" -rm -f -- testing/postgresql.log -trap stop_postgres EXIT INT TERM -pg_ctl start -D testing/postgresql-data/ -l testing/postgresql.log -w -s - -step "Running command: $*" -set +e -"$@" -EXIT_CODE=$? -set -e - -exit "${EXIT_CODE}"