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