Skip to content

Instantly share code, notes, and snippets.

@djaiss
Created November 25, 2019 13:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save djaiss/744757fdce6b5faf9580affc5863c98a to your computer and use it in GitHub Desktop.
Save djaiss/744757fdce6b5faf9580affc5863c98a to your computer and use it in GitHub Desktop.
Working example on how to use SQLite with a Laravel 6.x installation.
name: Unit tests
on: [push]
jobs:
phpunit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Create SQLite database
run: |
mkdir -p database
touch database/database.sqlite
- name: Run migrations
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan migrate
- name: Execute tests via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment