2020-11-23 22:39:32 +01:00
|
|
|
name: "CI"
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-12-31 14:18:49 +01:00
|
|
|
- master
|
|
|
|
- 2.*
|
2020-11-23 22:39:32 +01:00
|
|
|
|
|
|
|
env:
|
|
|
|
PGPASSWORD: wallabagrocks
|
|
|
|
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
phpunit:
|
|
|
|
name: "PHP ${{ matrix.php }} using ${{ matrix.database }}"
|
2022-01-05 14:01:13 +01:00
|
|
|
runs-on: "ubuntu-20.04"
|
2020-11-23 22:39:32 +01: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 09:27:20 +01:00
|
|
|
- "8.0"
|
|
|
|
- "8.1"
|
2020-11-23 22:39:32 +01:00
|
|
|
database:
|
|
|
|
- "sqlite"
|
|
|
|
- "mysql"
|
|
|
|
- "pgsql"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Checkout"
|
2022-04-11 21:50:03 +02:00
|
|
|
uses: "actions/checkout@v3"
|
2020-11-23 22:39:32 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: "Install PHP"
|
|
|
|
uses: "shivammathur/setup-php@v2"
|
|
|
|
with:
|
|
|
|
php-version: "${{ matrix.php }}"
|
|
|
|
coverage: none
|
2022-04-01 16:09:59 +02:00
|
|
|
tools: pecl, composer:2.2
|
2020-11-23 22:39:32 +01: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-13 00:54:21 +02: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 22:39:32 +01: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 10:16:03 +01:00
|
|
|
- name: "Install dependencies with Composer"
|
2022-01-31 09:27:20 +01:00
|
|
|
uses: "ramsey/composer-install@v2"
|
2020-11-23 22:39:32 +01:00
|
|
|
with:
|
2020-12-03 10:16:03 +01:00
|
|
|
composer-options: "--optimize-autoloader --prefer-dist"
|
2020-11-23 22:39:32 +01:00
|
|
|
|
|
|
|
- name: "Prepare database"
|
|
|
|
run: "make prepare DB=${{ matrix.database }}"
|
|
|
|
|
|
|
|
- name: "Prepare fixtures"
|
|
|
|
run: "make fixtures"
|
|
|
|
|
|
|
|
- name: "Run PHPUnit"
|
|
|
|
run: "php bin/simple-phpunit -v"
|