2020-11-23 21:39:32 +00:00
|
|
|
name: "CI"
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-12-31 13:18:49 +00:00
|
|
|
- master
|
2023-08-28 15:57:31 +00:00
|
|
|
- "2.**"
|
2020-11-23 21:39:32 +00:00
|
|
|
|
|
|
|
env:
|
2024-01-09 20:46:58 +00:00
|
|
|
# Force disabling the reporting of Doctrine deprecation notices for now
|
|
|
|
DOCTRINE_DEPRECATIONS: none
|
2020-11-23 21:39:32 +00:00
|
|
|
PGPASSWORD: wallabagrocks
|
|
|
|
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
phpunit:
|
|
|
|
name: "PHP ${{ matrix.php }} using ${{ matrix.database }}"
|
2022-01-05 13:01:13 +00:00
|
|
|
runs-on: "ubuntu-20.04"
|
2020-11-23 21:39:32 +00:00
|
|
|
services:
|
|
|
|
rabbitmq:
|
|
|
|
image: rabbitmq:3-alpine
|
|
|
|
ports:
|
|
|
|
- 5672:5672
|
|
|
|
redis:
|
|
|
|
image: redis:6-alpine
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
php:
|
|
|
|
- "7.4"
|
2022-01-31 08:27:20 +00:00
|
|
|
- "8.0"
|
|
|
|
- "8.1"
|
2023-04-24 13:20:58 +00:00
|
|
|
- "8.2"
|
2023-10-09 17:15:07 +00:00
|
|
|
- "8.3"
|
2020-11-23 21:39:32 +00:00
|
|
|
database:
|
|
|
|
- "sqlite"
|
|
|
|
- "mysql"
|
|
|
|
- "pgsql"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Checkout"
|
2023-09-11 02:30:18 +00:00
|
|
|
uses: "actions/checkout@v4"
|
2020-11-23 21:39:32 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: "Install PHP"
|
|
|
|
uses: "shivammathur/setup-php@v2"
|
|
|
|
with:
|
|
|
|
php-version: "${{ matrix.php }}"
|
|
|
|
coverage: none
|
2022-05-21 21:46:49 +00:00
|
|
|
tools: pecl
|
2020-11-23 21:39:32 +00:00
|
|
|
extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
|
|
|
|
ini-values: "date.timezone=Europe/Paris"
|
|
|
|
|
|
|
|
- name: "Setup MySQL"
|
|
|
|
if: "${{ matrix.database == 'mysql' }}"
|
2022-05-12 22:54:21 +00:00
|
|
|
run: |
|
|
|
|
sudo systemctl start mysql.service
|
|
|
|
sudo mysql -u root -proot -h 127.0.0.1 -e "CREATE DATABASE wallabag_test"
|
2020-11-23 21:39:32 +00:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2020-12-03 09:16:03 +00:00
|
|
|
- name: "Install dependencies with Composer"
|
2022-01-31 08:27:20 +00:00
|
|
|
uses: "ramsey/composer-install@v2"
|
2020-11-23 21:39:32 +00:00
|
|
|
with:
|
2020-12-03 09:16:03 +00:00
|
|
|
composer-options: "--optimize-autoloader --prefer-dist"
|
2020-11-23 21:39:32 +00:00
|
|
|
|
2024-01-07 21:29:51 +00:00
|
|
|
- name: "Prepare database configuration"
|
|
|
|
run: cp app/config/tests/parameters_test.${{ matrix.database }}.yml app/config/parameters_test.yml
|
2020-11-23 21:39:32 +00:00
|
|
|
|
|
|
|
- name: "Run PHPUnit"
|
2024-01-03 22:46:08 +00:00
|
|
|
run: "php bin/phpunit -v"
|
2023-07-17 11:53:31 +00:00
|
|
|
|
|
|
|
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"
|
2023-09-11 02:30:18 +00:00
|
|
|
uses: "actions/checkout@v4"
|
2023-07-17 11:53:31 +00:00
|
|
|
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"
|
|
|
|
|
2024-01-07 21:29:51 +00:00
|
|
|
- name: "Prepare database configuration"
|
|
|
|
run: cp app/config/tests/parameters_test.${{ matrix.database }}.yml app/config/parameters_test.yml
|
2023-07-17 11:53:31 +00:00
|
|
|
|
|
|
|
- name: "Run PHPUnit"
|
2024-01-03 22:46:08 +00:00
|
|
|
run: "php bin/phpunit -v"
|