diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index cf9cb3d..5e1482e 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -8,8 +8,10 @@ on: jobs: unit-tests: - runs-on: ubuntu-latest + strategy: + matrix: + php: [8.2, 8.3, 8.4] services: mysql: @@ -23,25 +25,34 @@ jobs: - 33306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - strategy: - matrix: - php: [8.2, 8.3, 8.4] - steps: + - uses: actions/checkout@v3 - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e with: php-version: ${{ matrix.php }} - - uses: actions/checkout@v3 + + - name: Cache Composer + uses: actions/cache@v3 + with: + path: vendor + key: composer-${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + restore-keys: composer-${{ runner.os }}- + - 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-progress --prefer-dist + - name: Install yarn run: yarn && yarn run build + - name: Generate key run: php artisan key:generate + - name: Directory Permissions run: chmod -R 777 storage bootstrap/cache + - name: Execute tests (Unit and Feature tests) via PHPUnit env: MYSQL_DATABASE: shortie