From 3d4e5cde77640dc1f6ba3180ff3bfd80e63e93c9 Mon Sep 17 00:00:00 2001 From: PovilasKorop Date: Tue, 9 Nov 2021 11:57:38 +0200 Subject: [PATCH] Update laravel.yml --- .github/workflows/laravel.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index a99a528..ce8f5aa 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -11,23 +11,20 @@ jobs: runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_USER: root - MYSQL_PASSWORD: password - MYSQL_DATABASE: test - ports: - - 33306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e with: php-version: '8.0' - uses: actions/checkout@v2 + + - name: Set up MySQL + env: + MYSQL_USER: root + MYSQL_PASSWORD: root + MYSQL_DATABASE: test_db + run: | + sudo /etc/init.d/mysql start + mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} - name: Copy .env run: php -r "file_exists('.env') || copy('.env.example', '.env');" - name: Install Dependencies @@ -42,6 +39,7 @@ jobs: touch database/database.sqlite - name: Execute tests (Unit and Feature tests) via PHPUnit env: - DB_PASSWORD: password - DB_DATABASE: test + DB_USERNAME: root + DB_PASSWORD: root + DB_DATABASE: test_db run: vendor/bin/phpunit