16 runs-on: ubuntu-latest
21 - uses: actions/checkout@v1
23 - name: Cache composer packages
26 echo "::set-output name=dir::$(composer config cache-files-dir)"
27 uses: actions/cache@v1
29 path: ${{ steps.composer-cache.outputs.dir }}
30 key: ${{ runner.os }}-composer-${{ matrix.php }}
32 - name: Setup Database
34 mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS `bookstack-test`;'
35 mysql -uroot -proot -e "CREATE USER 'bookstack-test'@'localhost' IDENTIFIED BY 'bookstack-test';"
36 mysql -uroot -proot -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';"
37 mysql -uroot -proot -e 'FLUSH PRIVILEGES;'
39 - name: Install composer dependencies & Test
40 run: composer install --prefer-dist --no-interaction --ansi
42 - name: Migrate and seed the database
44 php${{ matrix.php }} artisan migrate --force -n --database=mysql_testing
45 php${{ matrix.php }} artisan db:seed --force -n --class=DummyContentSeeder --database=mysql_testing
48 run: php${{ matrix.php }} ./vendor/bin/phpunit