1
0
Fork 0

fixed laravel test error

main
A1Gard 1 year ago committed by GitHub
parent 630807ebad
commit 206daee778
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,4 @@
name: Laravel test via MySQL name: Laravel
on: on:
push: push:
@ -11,40 +11,27 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: test_db
MYSQL_USER: user
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secretroot
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps: steps:
- uses: actions/checkout@v2 - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
- name: Verify MySQL connection php-version: '8.1'
run: | - uses: actions/checkout@v3
mysql --version - name: Copy .env
sudo apt-get install -y mysql-client run: php -r "file_exists('.env') || copy('.env.example', '.env');"
mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -uuser -psecret -e "SHOW DATABASES" - name: Install Dependencies
- name: Copy .env run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
run: php -r "file_exists('.env') || copy('.env.example', '.env');" - name: Generate key
run: php artisan key:generate
- name: Install Dependencies - name: Directory Permissions
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist run: chmod -R 777 storage bootstrap/cache
- name: Create Database
- name: Directory Permissions run: |
run: chmod -R 777 storage bootstrap/cache mkdir -p database
touch database/database.sqlite
- name: Key generate - name: Dataseeder
run: php artisan key:generate env:
DB_CONNECTION: sqlite
- name: Database seeder test DB_DATABASE: database/database.sqlite
run: php artisan migrate:fresh --seed run: php artisan migrate --seed
- name: Execute tests (Unit and Feature tests) via PHPUnit
- name : Developer test run: vendor/bin/phpunit
run: php artisan tes

Loading…
Cancel
Save