Fixes for tests

This commit is contained in:
David Bomba 2021-02-04 20:01:20 +11:00
parent ddd67071cc
commit 8c404644b0

View File

@ -1,11 +1,11 @@
on: on:
push: push:
branches: branches:
- v5-develop - v5-develop
pull_request: pull_request:
branches: branches:
- v5-develop - v5-develop
name: phpunit name: phpunit
jobs: jobs:
run: run:
@ -13,7 +13,7 @@ jobs:
strategy: strategy:
matrix: matrix:
operating-system: ['ubuntu-18.04', 'ubuntu-20.04'] operating-system: ['ubuntu-18.04', 'ubuntu-20.04']
php-versions: ['7.3', '7.4'] php-versions: ['7.4']
phpunit-versions: ['latest'] phpunit-versions: ['latest']
env: env:
@ -24,7 +24,7 @@ jobs:
DB_DATABASE: ninja DB_DATABASE: ninja
DB_USERNAME: root DB_USERNAME: root
DB_PASSWORD: ninja DB_PASSWORD: ninja
DB_HOST: '127.0.0.1' DB_HOST: '127.0.0.1'
BROADCAST_DRIVER: log BROADCAST_DRIVER: log
CACHE_DRIVER: file CACHE_DRIVER: file
QUEUE_CONNECTION: sync QUEUE_CONNECTION: sync
@ -47,13 +47,13 @@ jobs:
MYSQL_DATABASE: ninja MYSQL_DATABASE: ninja
MYSQL_ROOT_PASSWORD: ninja MYSQL_ROOT_PASSWORD: ninja
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps: steps:
- name: Start mysql service - name: Start mysql service
run: | run: |
sudo /etc/init.d/mysql start sudo /etc/init.d/mysql start
- name: Sleep for 30 seconds //allows time for MySQL to start - name: Sleep for 30 seconds to allow mysql to start
uses: jakejarvis/wait-action@master uses: jakejarvis/wait-action@master
with: with:
time: '30s' time: '30s'
@ -67,13 +67,12 @@ jobs:
while ! mysqladmin ping -h"127.0.0.1" -P"$DB_PORT" --silent; do while ! mysqladmin ping -h"127.0.0.1" -P"$DB_PORT" --silent; do
sleep 1 sleep 1
done done
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: ${{ matrix.php-versions }} php-version: ${{ matrix.php-versions }}
extensions: mysql, mysqlnd, sqlite3, bcmath, gmp, gd, curl, zip, openssl, mbstring, xml extensions: mysql, mysqlnd, sqlite3, bcmath, gmp, gd, curl, zip, openssl, mbstring, xml
- uses: actions/checkout@v1 - uses: actions/checkout@v1
with: with:
ref: v5-develop ref: v5-develop
@ -82,7 +81,6 @@ jobs:
- name: Copy .env - name: Copy .env
run: | run: |
cp .env.ci .env cp .env.ci .env
- name: Install composer dependencies - name: Install composer dependencies
run: | run: |
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
@ -93,12 +91,10 @@ jobs:
php artisan optimize php artisan optimize
php artisan cache:clear php artisan cache:clear
php artisan config:cache php artisan config:cache
- name: Create DB and schemas - name: Create DB and schemas
run: | run: |
mkdir -p database mkdir -p database
touch database/database.sqlite touch database/database.sqlite
- name: Migrate Database - name: Migrate Database
run: | run: |
php artisan migrate:fresh --seed --force && php artisan db:seed --force php artisan migrate:fresh --seed --force && php artisan db:seed --force
@ -106,7 +102,6 @@ jobs:
run: | run: |
npm i npm i
npm run production npm run production
- name: Run Testsuite - name: Run Testsuite
run: | run: |
cat .env cat .env
@ -117,4 +112,3 @@ jobs:
- name: Run php-cs-fixer - name: Run php-cs-fixer
run: | run: |
vendor/bin/php-cs-fixer fix vendor/bin/php-cs-fixer fix