From 09dc9f53f34adf0901f939a6949685e2576efe98 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 14:53:22 -0500 Subject: [PATCH] Trying @pashagolub's suggestion --- .github/scripts/init-postgres.sh | 6 ------ .github/workflows/test-all-Ubuntu.yml | 24 ++++++++++++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) delete mode 100644 .github/scripts/init-postgres.sh diff --git a/.github/scripts/init-postgres.sh b/.github/scripts/init-postgres.sh deleted file mode 100644 index 03069d5ac..000000000 --- a/.github/scripts/init-postgres.sh +++ /dev/null @@ -1,6 +0,0 @@ -#/bin/bash - -psql -c 'CREATE DATABASE libretime;' -U postgres -psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" -U postgres -psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' -U postgres -psql -c 'ALTER USER libretime CREATEDB;' -U postgres \ No newline at end of file diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index b837ae615..9d2084a22 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -17,13 +17,25 @@ jobs: - uses: actions/setup-python@v2 with: python-version: '3.6' + - name: Setup PostgreSQL + run: | + sudo systemctl start postgresql.service + pg_isready + sudo -u postgres psql -c 'CREATE DATABASE libretime;' + sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" + sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' + sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - - run: sudo bash ./.github/scripts/install-bionic.sh - - run: sudo bash ./.github/scripts/init-postgres.sh - - run: sudo composer install - - run: cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit && cd ../.. - - run: sudo bash ./.github/scripts/python-pkg-install.sh - - run: sudo bash ./.github/scripts/python-pkg-test.sh + - name: Install prerequisites + run: sudo bash ./.github/scripts/install-bionic.sh + - name: Run PHP tests + run: | + sudo composer install + cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit && cd ../.. + - name: Run Python tests + run: | + sudo bash ./.github/scripts/python-pkg-install.sh + sudo bash ./.github/scripts/python-pkg-test.sh # test-xenial: # runs-on: ubuntu-16.04 # steps: