mirror of
https://github.com/wallabag/wallabag.git
synced 2024-10-31 22:28:54 +00:00
Add a new build to test when no database table prefix are defined
This is mostly to avoid further error when users don't defined a database table prefix. it's recommenced to define one anyway. Also enable verbose migration so we'll be able to actually view SQL queries (and execution time).
This commit is contained in:
parent
df56bfe94e
commit
8b9fd04c74
2 changed files with 72 additions and 1 deletions
71
.github/workflows/continuous-integration.yml
vendored
71
.github/workflows/continuous-integration.yml
vendored
|
@ -80,3 +80,74 @@ jobs:
|
|||
|
||||
- name: "Run PHPUnit"
|
||||
run: "php bin/simple-phpunit -v"
|
||||
|
||||
phpunit_no_prefix:
|
||||
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without prefix"
|
||||
runs-on: "ubuntu-20.04"
|
||||
services:
|
||||
rabbitmq:
|
||||
image: rabbitmq:3-alpine
|
||||
ports:
|
||||
- 5672:5672
|
||||
redis:
|
||||
image: redis:6-alpine
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
php:
|
||||
- "8.2"
|
||||
database:
|
||||
- "sqlite"
|
||||
- "mysql"
|
||||
- "pgsql"
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v3"
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
php-version: "${{ matrix.php }}"
|
||||
coverage: none
|
||||
tools: pecl
|
||||
extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
|
||||
ini-values: "date.timezone=Europe/Paris"
|
||||
|
||||
- name: "Remove database prefix"
|
||||
run: |
|
||||
pip install --user yq
|
||||
yq -Y --in-place '.parameters.database_table_prefix = ""' app/config/parameters.yml.dist
|
||||
|
||||
- name: "Setup MySQL"
|
||||
if: "${{ matrix.database == 'mysql' }}"
|
||||
run: |
|
||||
sudo systemctl start mysql.service
|
||||
sudo mysql -u root -proot -h 127.0.0.1 -e "CREATE DATABASE wallabag_test"
|
||||
|
||||
- name: "Setup PostgreSQL"
|
||||
if: "${{ matrix.database == 'pgsql' }}"
|
||||
run: |
|
||||
sudo systemctl start postgresql
|
||||
sudo -u postgres psql -d template1 -c "CREATE USER wallabag WITH PASSWORD 'wallabagrocks' CREATEDB"
|
||||
createdb -h localhost -p 5432 -U wallabag wallabag_test
|
||||
pg_isready -d wallabag_test -h localhost -p 5432 -U wallabag
|
||||
|
||||
- name: "Install dependencies with Composer"
|
||||
uses: "ramsey/composer-install@v2"
|
||||
with:
|
||||
composer-options: "--optimize-autoloader --prefer-dist"
|
||||
|
||||
- name: "Prepare database"
|
||||
run: "make prepare DB=${{ matrix.database }}"
|
||||
|
||||
- name: "Prepare fixtures"
|
||||
run: "make fixtures"
|
||||
|
||||
- name: "Run PHPUnit"
|
||||
run: "php bin/simple-phpunit -v"
|
||||
|
|
|
@ -40,7 +40,7 @@ ifdef DB
|
|||
endif
|
||||
-php bin/console doctrine:database:drop --force --env=test
|
||||
php bin/console doctrine:database:create --env=test
|
||||
php bin/console doctrine:migrations:migrate --no-interaction --env=test
|
||||
php bin/console doctrine:migrations:migrate --no-interaction --env=test -vv
|
||||
|
||||
fixtures: ## Load fixtures into database
|
||||
php bin/console doctrine:fixtures:load --no-interaction --env=test
|
||||
|
|
Loading…
Reference in a new issue