more environment setup

This commit is contained in:
Shish 2019-11-21 17:34:07 +00:00
parent 17e2662d06
commit 417f16079b
1 changed files with 11 additions and 3 deletions

View File

@ -28,26 +28,34 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
- name: Install system dependencies
run: sudo apt-get install -y postgres-client
- name: Install PHP dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Install shimmie
- name: Pre-configure database
run: |
mkdir -p data/config
if [[ "${{ matrix.database }}" == "pgsql" ]]; then
psql --version ;
psql -c "SELECT set_config('log_statement', 'all', false);" -U postgres ;
psql -c "CREATE DATABASE shimmie;" -U postgres ;
echo '<?php define("DATABASE_DSN", "pgsql:user=postgres;password=;host=;dbname=shimmie");' > data/config/auto_install.conf.php ;
fi
if [[ "${{ matrix.database }}" == "mysql" ]]; then
mysql --version ;
mysql -e "SET GLOBAL general_log = 'ON';" -uroot ;
mysql -e "CREATE DATABASE shimmie;" -uroot ;
echo '<?php define("DATABASE_DSN", "mysql:user=root;password=;host=127.0.0.1;dbname=shimmie");' > data/config/auto_install.conf.php ;
fi
if [[ "${{ matrix.database }}" == "sqlite" ]]; then
sqlite3 --version ;
echo '<?php define("DATABASE_DSN", "sqlite:data/shimmie.sqlite");' > data/config/auto_install.conf.php ;
fi
php index.php
- name: Install shimmie
run: php index.php
- name: Run test suite
run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover=data/coverage.clover