Merge remote-tracking branch 'origin/main'

pull/22/head
A1Gard 1 year ago
commit 27cadf29f8

@ -1,4 +1,4 @@
name: Laravel name: Laravel test via MySQL
on: on:
push: push:
@ -11,32 +11,45 @@ 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: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e - uses: actions/checkout@v2
with:
php-version: '8.1' - name: Verify MySQL connection
- uses: actions/checkout@v3 run: |
- name: Copy .env mysql --version
run: php -r "file_exists('.env') || copy('.env.example', '.env');" sudo apt-get install -y mysql-client
- name: Install Dependencies mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -uuser -psecret -e "SHOW DATABASES"
# run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - name: Copy .env
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist run: php -r "file_exists('.env') || copy('.env.github', '.env');"
# - name: Compser dump
# run: composer dump-autoload --no-ansi --no-interaction --no-scripts - 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: Execute tests (Unit and Feature tests) via PHPUnit
- name: Execute tests (Unit and Feature tests) via PHPUnit env:
env: MYSQL_DATABASE: test_db
DB_CONNECTION: sqlite DB_USERNAME: user
DB_DATABASE: database/database.sqlite DB_PASSWORD: secret
run: vendor/bin/phpunit DB_PORT: ${{ job.services.mysql.ports[3306] }}
- name: Generate key run: php artisan key:generate
run: php artisan key:generate
- name: Database seeder test - name: Database seeder test
run: php artisan migrate:fresh --seed run: php artisan migrate:fresh --seed
- name : Developer test
run: php artisan test - name : Developer test
run: php artisan tes

Loading…
Cancel
Save