diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a025ca..edfd556 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,49 +3,15 @@ name: Test on: push jobs: - test-macos: + test: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest] + os: [macos-latest, ubuntu-latest] + test_script: [mongodb-test.sh, mysql-test.sh, postgresql-12-test.sh, postgresql-13-test.sh, redis-test.sh] steps: - uses: actions/checkout@v3 - - name: Run mongodb test + - name: Run test run: | cd tests - /bin/bash mongodb-test.sh - - name: Run mysql test - run: | - cd tests - /bin/bash mysql-test.sh - - name: Run postgresql test - run: | - cd tests - /bin/bash postgresql-test.sh - - name: Run redis test - run: | - cd tests - /bin/bash redis-test.sh - test-ubuntu: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Run mongodb test - run: | - cd tests - /bin/bash mongodb-test.sh - - name: Run mysql test - run: | - cd tests - /bin/bash mysql-test.sh - - name: Run postgresql test - run: | - cd tests - /bin/bash postgresql-test.sh - - name: Run redis test - run: | - cd tests - /bin/bash redis-test.sh + /bin/bash ${{ matrix.test_script }} diff --git a/VERSION b/VERSION index 408f0de..a35de1f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.2.11 +v1.2.12 diff --git a/postgresql/create.sh b/postgresql/create.sh index 34dd02b..4af3206 100755 --- a/postgresql/create.sh +++ b/postgresql/create.sh @@ -59,9 +59,9 @@ if [ ! -d $dir/basedir/bin ]; then if [ $os = "linux" ]; then echo "Installing..." 1>&2 cd $dir/basedir - ./configure --prefix=$(pwd) 1>&2 - make 1>&2 - make install 1>&2 + ./configure --prefix=$(pwd) > /dev/null 2>&1 + make > /dev/null 2>&1 + make install > /dev/null 2>&1 rm -fr config contrib doc src fi fi diff --git a/redis/create.sh b/redis/create.sh index c5a3e84..c7f0702 100755 --- a/redis/create.sh +++ b/redis/create.sh @@ -55,7 +55,8 @@ extractFile $dir $optFileName if [ ! -e $dir/basedir/src/redis-server ]; then cd $dir/basedir - make 1>&2 + echo "Installing..." 1>&2 + make > /dev/null 2>&1 fi # create redis.conf diff --git a/tests/postgresql-test.sh b/tests/postgresql-12-test.sh similarity index 82% rename from tests/postgresql-test.sh rename to tests/postgresql-12-test.sh index c82990d..faabe2d 100755 --- a/tests/postgresql-test.sh +++ b/tests/postgresql-12-test.sh @@ -4,8 +4,7 @@ set -aeuvx . ../lib/functions.sh type=postgresql -oldVersion=12.4 -newVersion=13.2 +version=12.4 cd ../$type rm -fr $type-*.tar.gz @@ -17,7 +16,7 @@ md5="md5" hash=$(echo "dbdb-$date" | $md5 | cut -d ' ' -f 1) echo "Test create" -./$type/create.sh dbdb-test-$hash $oldVersion random +./$type/create.sh dbdb-test-$hash $version random echo "Test port" ./$type/port.sh dbdb-test-$hash echo "Test start" @@ -32,7 +31,7 @@ echo "Test delete" ./$type/delete.sh dbdb-test-$hash echo "Test create" -./$type/create.sh -f json dbdb-test-$hash $newVersion random | jq +./$type/create.sh -f json dbdb-test-$hash $version random | jq echo "Test port" ./$type/port.sh -f json dbdb-test-$hash | jq echo "Test start" @@ -47,6 +46,6 @@ echo "Test delete" ./$type/delete.sh -f json dbdb-test-$hash | jq ./dbdb.sh -./$type/create-start.sh -f json dbdb-test-$hash $newVersion random | jq +./$type/create-start.sh -f json dbdb-test-$hash $version random | jq ./dbdb.sh -f json | jq ./$type/delete.sh dbdb-test-$hash diff --git a/tests/postgresql-13-test.sh b/tests/postgresql-13-test.sh new file mode 100755 index 0000000..82f4f0c --- /dev/null +++ b/tests/postgresql-13-test.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +set -aeuvx + +. ../lib/functions.sh + +type=postgresql +version=13.2 + +cd ../$type +rm -fr $type-*.tar.gz +cd .. + +date=$(date +%Y%m%d%H%M%S) +md5="md5" +[ "$(getOS)" = "linux" ] && md5="md5sum" +hash=$(echo "dbdb-$date" | $md5 | cut -d ' ' -f 1) + +echo "Test create" +./$type/create.sh dbdb-test-$hash $version random +echo "Test port" +./$type/port.sh dbdb-test-$hash +echo "Test start" +./$type/start.sh dbdb-test-$hash +echo "Test status" +./$type/status.sh dbdb-test-$hash +echo "Test restart" +./$type/restart.sh dbdb-test-$hash +echo "Test stop" +./$type/stop.sh dbdb-test-$hash +echo "Test delete" +./$type/delete.sh dbdb-test-$hash + +echo "Test create" +./$type/create.sh -f json dbdb-test-$hash $version random | jq +echo "Test port" +./$type/port.sh -f json dbdb-test-$hash | jq +echo "Test start" +./$type/start.sh -f json dbdb-test-$hash | jq +echo "Test status" +./$type/status.sh -f json dbdb-test-$hash | jq +echo "Test restart" +./$type/restart.sh -f json dbdb-test-$hash | jq +echo "Test stop" +./$type/stop.sh -f json dbdb-test-$hash | jq +echo "Test delete" +./$type/delete.sh -f json dbdb-test-$hash | jq + +./dbdb.sh +./$type/create-start.sh -f json dbdb-test-$hash $version random | jq +./dbdb.sh -f json | jq +./$type/delete.sh dbdb-test-$hash