Use Postgresql in tests

This commit is contained in:
Jonny Barnes 2020-10-17 12:09:01 +01:00
parent 3c3463d33f
commit a4f8e6f5b2
2 changed files with 14 additions and 12 deletions

View file

@ -7,9 +7,9 @@ APP_LOG_LEVEL=warning
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
DB_DATABASE=jbuktest
DB_USERNAME=postgres
DB_PASSWORD=postgres
BROADCAST_DRIVER=log
CACHE_DRIVER=file

View file

@ -8,7 +8,17 @@ jobs:
phpunit:
runs-on: ubuntu-latest
name: PHPUnit
name: PHPUnit test suite
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: jbuktest
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
@ -22,15 +32,7 @@ jobs:
run: chmod -R 777 storage bootstrap/cache
- name: Setup test database
run: |
mkdir -p database
touch database/database.sqlite
php artisan migrate
php artisan db:seed
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
CACHE_DRIVER: array
SESSION_DRIVER: array
QUEUE_DRIVER: sync
run: vendor/bin/phpunit