From c5588bb626385ed78b26c3f32e2da54ab9eee378 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 23 Jun 2022 14:31:41 +0200 Subject: [PATCH] Test database as well --- .woodpecker/.build.yml | 21 ++++++++++++++++++++- tests/makephar.sh | 15 ++++++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.woodpecker/.build.yml b/.woodpecker/.build.yml index 4ec54cce6..6e8be2f94 100644 --- a/.woodpecker/.build.yml +++ b/.woodpecker/.build.yml @@ -10,7 +10,9 @@ matrix: clone: git: when: - event: tag + event: + - tag + - push image: woodpeckerci/plugin-git settings: depth: 1 @@ -36,3 +38,20 @@ pipeline: commands: - tests/makephar.sh +services: + mariadb: + image: mariadb + environment: + - MARIADB_DATABASE=MadelineProto + - MARIADB_USER=MadelineProto + - MARIADB_PASSWORD=test + + postgres: + image: postgres + environment: + - POSTGRES_DB=MadelineProto + - POSTGRES_USER=MadelineProto + - POSTGRES_PASSWORD=test + + redis: + image: redis \ No newline at end of file diff --git a/tests/makephar.sh b/tests/makephar.sh index 38ba4a071..cff11e806 100755 --- a/tests/makephar.sh +++ b/tests/makephar.sh @@ -6,6 +6,10 @@ export PATH="$HOME/.local/php/$PHP_VERSION:$PATH" echo "$TAG" | grep -q '\.9999' && exit 0 || true echo "$TAG" | grep -q '\.9998' && exit 0 || true +if [ "$TAG" == "" ]; then + export TAG=7777 +fi + PHP_MAJOR_VERSION=$(php -r 'echo PHP_MAJOR_VERSION;') PHP_MINOR_VERSION=$(php -r 'echo PHP_MINOR_VERSION;') php=$PHP_MAJOR_VERSION$PHP_MINOR_VERSION @@ -94,7 +98,6 @@ runTestSimple() } runTest() { - [ "$1" != "" ] && p="$1" || p=php echo "m $API_ID $API_HASH @@ -158,7 +161,9 @@ input=$PWD cd "$madelinePath" -cp "$input/madeline$php$branch.phar" "madeline$php.phar" -git remote add hub https://github.com/danog/MadelineProto -gh release upload "$TAG" "madeline$php.phar" -rm "madeline$php.phar" +if [ "$TAG" != "7777" ]; then + cp "$input/madeline$php$branch.phar" "madeline$php.phar" + git remote add hub https://github.com/danog/MadelineProto + gh release upload "$TAG" "madeline$php.phar" + rm "madeline$php.phar" +fi \ No newline at end of file