Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 10 #103

Merged
merged 15 commits into from
Apr 20, 2024
8 changes: 8 additions & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
APP_ENV=testing
APP_KEY=base64:wevTz42eYncA2j32iQwRWyu5DFb4QVydrl/PmLxxx1s=
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root
74 changes: 49 additions & 25 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Laravel
name: Laravel CI

on:
push:
Expand All @@ -7,29 +7,53 @@ on:
branches: [ "main" ]

jobs:
laravel-tests:
laravel:
name: Laravel Testsuite
runs-on: ubuntu-20.04 # has mysql 8 installed by default
steps:
- name: Set Up Mysql 8
run: |
echo -e "Enable LOAD DATA LOCAL INFILE in my.cnf\n"
echo -e "SETTING secure-file-priv TO EMPTY STRING\n"
echo -e "[mysqld]\nsecure-file-priv=''" | sudo tee -a /etc/mysql/my.cnf
echo -e "SETTING local_infile TO ON\n"
echo -e "[mysqld]\nlocal_infile='ON'" | sudo tee -a /etc/mysql/my.cnf
echo -e "Start MYSQL service, it is off by default\n"
sudo systemctl enable mysql.service
sudo systemctl start mysql.service
echo -e "Creating Laravel Database\n"
mysql --host 127.0.0.1 -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS laravel;'
echo -e "Check new settings\n"
mysql --host 127.0.0.1 -uroot -proot -e "SELECT @@global.secure_file_priv, @@global.local_infile"
- name: Checkout
uses: actions/checkout@v2

runs-on: ubuntu-latest
- name: Get Composer Cache Directory
id: get-composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer
uses: actions/cache@v1
id: composer-cache
with:
path: ${{ steps.get-composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.0'
- uses: actions/checkout@v3
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan test
- name: Install composer dependencies
run: composer install -q --no-progress --prefer-dist --no-interaction --no-suggest --optimize-autoloader --no-scripts

- name: Clear Config
run: |
php artisan config:clear
php artisan cache:clear
- name: Prepare the application
run: |
cp .env.ci .env
php artisan key:generate
- name: Run Migrations
run: php artisan migrate --force -v

- name: Test with phpunit
run: ./vendor/bin/pest
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Kernel extends HttpKernel
*
* @var array
*/
protected $routeMiddleware = [
protected $middlewareAliases = [
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->registerPolicies();
//
}
}
57 changes: 28 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,40 @@
"license": "MIT",
"type": "project",
"require": {
"php": "^8.0.2",
"php": "^8.2.0",
"ext-exif": "*",
"ext-gd": "*",
"artesaos/seotools": "^0.22.0",
"blade-ui-kit/blade-icons": "^1.1",
"codeat3/blade-ant-design-icons": "^1.2",
"codeat3/blade-clarity-icons": "^1.3",
"doctrine/dbal": "^2.13",
"guzzlehttp/guzzle": "^7.0.1",
"intervention/image": "^2.4",
"artesaos/seotools": "^1.3",
"blade-ui-kit/blade-icons": "^1.6",
"codeat3/blade-ant-design-icons": "^2.0",
"codeat3/blade-clarity-icons": "^1.9",
"guzzlehttp/guzzle": "^7.8",
"intervention/image": "^2.7",
"jenssegers/date": "^4.0",
"lab404/laravel-impersonate": "^1.2",
"laravel/framework": "^9.0",
"laravel/helpers": "^1.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^3.4",
"livewire/livewire": "^2.8",
"matanyadaev/laravel-eloquent-spatial": "^2.10",
"lab404/laravel-impersonate": "^1.7",
"laravel/framework": "^10.0",
"laravel/helpers": "^1.7",
"laravel/tinker": "^2.9",
"laravel/ui": "^4.5",
"livewire/livewire": "^3.4",
"matanyadaev/laravel-eloquent-spatial": "^4.2",
"orangehill/iseed": "^3.0",
"spatie/laravel-sitemap": "^6.1",
"tcg/voyager": "1.6.*",
"tymon/jwt-auth": "dev-develop"
"tcg/voyager": "^1.7",
"tymon/jwt-auth": "^2.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.6",
"spatie/laravel-ignition": "^1.0",
"fakerphp/faker": "^1.9.1",
"kitloong/laravel-migrations-generator": "^5.0",
"laravel/dusk": "^6.0",
"laravel/sail": "^1.4",
"mockery/mockery": "^1.3.1",
"pestphp/pest-plugin-laravel": "^1.0",
"phpunit/phpunit": "^9.3.3",
"slevomat/coding-standard": "^7.0",
"squizlabs/php_codesniffer": "^3.6"
"barryvdh/laravel-debugbar": "^3.13",
"fakerphp/faker": "^1.23",
"kitloong/laravel-migrations-generator": "^7.0",
"laravel/dusk": "^8.2",
"laravel/sail": "^1.29",
"mockery/mockery": "^1.6",
"pestphp/pest-plugin-laravel": "^2.3",
"phpunit/phpunit": "^10.5",
"slevomat/coding-standard": "^8.15",
"spatie/laravel-ignition": "^2.5",
"spatie/laravel-sitemap": "^7.2",
"squizlabs/php_codesniffer": "^3.9"
},
"autoload": {
"psr-4": {
Expand Down
Loading
Loading