3 on: [push, pull_request]
7 if: ${{ github.ref != 'refs/heads/l10n_development' }}
11 php: ['7.4', '8.0', '8.1']
13 - uses: actions/checkout@v1
16 uses: shivammathur/setup-php@v2
18 php-version: ${{ matrix.php }}
19 extensions: gd, mbstring, json, curl, xml, mysql, ldap
21 - name: Get Composer Cache Directory
24 echo "::set-output name=dir::$(composer config cache-files-dir)"
26 - name: Cache composer packages
27 uses: actions/cache@v1
29 path: ${{ steps.composer-cache.outputs.dir }}
30 key: ${{ runner.os }}-composer-${{ matrix.php }}
34 sudo systemctl start mysql
36 - name: Create database & user
38 mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS `bookstack-test`;'
39 mysql -uroot -proot -e "CREATE USER 'bookstack-test'@'localhost' IDENTIFIED WITH mysql_native_password BY 'bookstack-test';"
40 mysql -uroot -proot -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';"
41 mysql -uroot -proot -e 'FLUSH PRIVILEGES;'
43 - name: Install composer dependencies
44 run: composer install --prefer-dist --no-interaction --ansi
46 - name: Start migration test
48 php${{ matrix.php }} artisan migrate --force -n --database=mysql_testing
50 - name: Start migration:rollback test
52 php${{ matrix.php }} artisan migrate:rollback --force -n --database=mysql_testing
54 - name: Start migration rerun test
56 php${{ matrix.php }} artisan migrate --force -n --database=mysql_testing