From 172bd247851af94ff6fd1e44e93e45142a7643d5 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Tue, 6 Feb 2024 15:23:33 -0500 Subject: [PATCH] Move no_cluster test to a script --- .github/workflows/cicd.yml | 11 +---------- test/no_cluster_test.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100755 test/no_cluster_test.sh diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 04754bc..b21f65c 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -35,16 +35,7 @@ jobs: # Test NO_CLUSTER - name: Test NO_CLUSTER env: { NO_CLUSTER: true } - run: |- - docker run -w /repo --rm pgxn-tools-test pg-start ${{ matrix.pg }} - if [ $? -ne 0 ]; then - echo "ERROR: error returned from script" - exit 1 - fi - if [ -d /var/lib/postgresql/${{ matrix.pg }}/test ]; then - echo "ERROR: /var/lib/postgresql/${{ matrix.pg }}/test should not exist!" - exit 1 - fi + run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" pgxn-tools-test ./test/no_cluster_test.sh ${{ matrix.pg }}" publish: # Publish for a tag starting with v. diff --git a/test/no_cluster_test.sh b/test/no_cluster_test.sh new file mode 100755 index 0000000..2989b54 --- /dev/null +++ b/test/no_cluster_test.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +pgversion=$1 +if ! pg-start "$pgversion"; then + echo "ERROR: error returned from script" + exit 1 +fi + +if [ -d "/var/lib/postgresql/$pgversion/test" ]; then + echo "ERROR: /var/lib/postgresql/$pgversion/test should not exist!" + exit 1; +fi