mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +08:00
bc69588785
The MySQL service is no longer started by default on these agents. See https://github.blog/changelog/2020-02-21-github-actions-breaking-change-ubuntu-virtual-environments-will-no-longer-start-the-mysql-service-automatically/.
68 lines
1.5 KiB
YAML
68 lines
1.5 KiB
YAML
name: Tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
php: [7.2, 7.3, 7.4]
|
|
service: ['mysql:5.7', mariadb]
|
|
prefix: ['', flarum_]
|
|
|
|
include:
|
|
- service: 'mysql:5.7'
|
|
db: MySQL
|
|
- service: mariadb
|
|
db: MariaDB
|
|
- prefix: flarum_
|
|
prefixStr: (prefix)
|
|
|
|
exclude:
|
|
- php: 7.2
|
|
service: 'mysql:5.7'
|
|
prefix: flarum_
|
|
- php: 7.2
|
|
service: mariadb
|
|
prefix: flarum_
|
|
- php: 7.3
|
|
service: 'mysql:5.7'
|
|
prefix: flarum_
|
|
- php: 7.3
|
|
service: mariadb
|
|
prefix: flarum_
|
|
|
|
services:
|
|
mysql:
|
|
image: ${{ matrix.service }}
|
|
ports:
|
|
- 13306:3306
|
|
|
|
name: 'PHP ${{ matrix.php }} / ${{ matrix.db }} ${{ matrix.prefixStr }}'
|
|
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
|
|
- name: Select PHP version
|
|
run: sudo update-alternatives --set php $(which php${{ matrix.php }})
|
|
|
|
- name: Create MySQL Database
|
|
run: |
|
|
sudo systemctl start mysql
|
|
mysql -uroot -proot -e 'CREATE DATABASE flarum_test;' --port 13306
|
|
|
|
- name: Install Composer dependencies
|
|
run: composer install
|
|
|
|
- name: Setup Composer tests
|
|
run: composer test:setup
|
|
env:
|
|
DB_PORT: 13306
|
|
DB_PASSWORD: root
|
|
DB_PREFIX: ${{ matrix.prefix }}
|
|
|
|
- name: Run Composer tests
|
|
run: composer test
|