Add an action for unit tests
This commit is contained in:
parent
36f319cd75
commit
d0a4c73844
1 changed files with 36 additions and 0 deletions
36
.github/workflows/run-tests.yml
vendored
Normal file
36
.github/workflows/run-tests.yml
vendored
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
name: Run Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
phpunit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
name: PHPUnit
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- 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-progress
|
||||||
|
- name: Generate key
|
||||||
|
run: php artisan key:generate
|
||||||
|
- name: Setup directory permissions
|
||||||
|
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
|
Loading…
Add table
Add a link
Reference in a new issue