16 php: ['7.3', '7.4', '8.0', '8.1']
18 - uses: actions/checkout@v1
21 uses: shivammathur/setup-php@v2
23 php-version: ${{ matrix.php }}
24 extensions: gd, mbstring, json, curl, xml, mysql, ldap
26 - name: Get Composer Cache Directory
29 echo "::set-output name=dir::$(composer config cache-files-dir)"
31 - name: Cache composer packages
32 uses: actions/cache@v1
34 path: ${{ steps.composer-cache.outputs.dir }}
35 key: ${{ runner.os }}-composer-${{ matrix.php }}
37 - name: Start Database
39 sudo systemctl start mysql
41 - name: Setup Database
43 mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS `bookstack-test`;'
44 mysql -uroot -proot -e "CREATE USER 'bookstack-test'@'localhost' IDENTIFIED WITH mysql_native_password BY 'bookstack-test';"
45 mysql -uroot -proot -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';"
46 mysql -uroot -proot -e 'FLUSH PRIVILEGES;'
48 - name: Install composer dependencies
49 run: composer install --prefer-dist --no-interaction --ansi
51 - name: Migrate and seed the database
53 php${{ matrix.php }} artisan migrate --force -n --database=mysql_testing
54 php${{ matrix.php }} artisan db:seed --force -n --class=DummyContentSeeder --database=mysql_testing
57 run: php${{ matrix.php }} ./vendor/bin/phpunit