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: Setup Database
36 mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS `bookstack-test`;'
37 mysql -uroot -proot -e "CREATE USER 'bookstack-test'@'localhost' IDENTIFIED BY 'bookstack-test';"
38 mysql -uroot -proot -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';"
39 mysql -uroot -proot -e 'FLUSH PRIVILEGES;'
41 - name: Install composer dependencies & Test
42 run: composer install --prefer-dist --no-interaction --ansi
44 - name: Migrate and seed the database
46 php${{ matrix.php }} artisan migrate --force -n --database=mysql_testing
47 php${{ matrix.php }} artisan db:seed --force -n --class=DummyContentSeeder --database=mysql_testing
50 run: php${{ matrix.php }} ./vendor/bin/phpunit