mirror of
https://github.com/notf0und/SGS
synced 2026-07-17 18:21:06 +00:00
* Fix CI/CD php version
* Add Pint * Format code
This commit is contained in:
parent
0993bfa666
commit
bae79d68ab
@@ -16,7 +16,7 @@ jobs:
|
|||||||
- name: Set up PHP
|
- name: Set up PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.2'
|
php-version: '8.4'
|
||||||
extensions: mbstring
|
extensions: mbstring
|
||||||
coverage: none
|
coverage: none
|
||||||
|
|
||||||
@@ -34,10 +34,33 @@ jobs:
|
|||||||
working-directory: www
|
working-directory: www
|
||||||
run: php artisan test
|
run: php artisan test
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Check code style (Pint)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.4'
|
||||||
|
extensions: mbstring
|
||||||
|
coverage: none
|
||||||
|
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
working-directory: www
|
||||||
|
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
|
- name: Run Pint
|
||||||
|
working-directory: www
|
||||||
|
run: ./vendor/bin/pint --test
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
name: Build and push Docker image
|
name: Build and push Docker image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: test
|
needs: [test, lint]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
- name: Set up PHP
|
- name: Set up PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.2'
|
php-version: '8.4'
|
||||||
extensions: mbstring
|
extensions: mbstring
|
||||||
coverage: none
|
coverage: none
|
||||||
|
|
||||||
@@ -33,3 +33,26 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
working-directory: www
|
working-directory: www
|
||||||
run: php artisan test
|
run: php artisan test
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Check code style (Pint)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.4'
|
||||||
|
extensions: mbstring
|
||||||
|
coverage: none
|
||||||
|
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
working-directory: www
|
||||||
|
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
|
- name: Run Pint
|
||||||
|
working-directory: www
|
||||||
|
run: ./vendor/bin/pint --test
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Helpers;
|
|||||||
class FileSize
|
class FileSize
|
||||||
{
|
{
|
||||||
private const UNITS = ['', 'K', 'M', 'G', 'T'];
|
private const UNITS = ['', 'K', 'M', 'G', 'T'];
|
||||||
|
|
||||||
private const THRESHOLD = 1024;
|
private const THRESHOLD = 1024;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ class IndexController extends Controller
|
|||||||
private function getRequestPath(Request $request): ?string
|
private function getRequestPath(Request $request): ?string
|
||||||
{
|
{
|
||||||
$path = $request->route('path');
|
$path = $request->route('path');
|
||||||
|
|
||||||
return $path ? rawurldecode($path) : null;
|
return $path ? rawurldecode($path) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class IndexController extends Controller
|
|||||||
{
|
{
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'files' => $this->getInstallableFiles()->values(),
|
'files' => $this->getInstallableFiles()->values(),
|
||||||
'success' => config('app.name')
|
'success' => config('app.name'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ class IndexController extends Controller
|
|||||||
->filter(fn ($path) => NintendoFileExtension::isSupported($path))
|
->filter(fn ($path) => NintendoFileExtension::isSupported($path))
|
||||||
->map(fn ($path) => [
|
->map(fn ($path) => [
|
||||||
'url' => url($path),
|
'url' => url($path),
|
||||||
'size' => Storage::size($path)
|
'size' => Storage::size($path),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,20 +6,17 @@ use Closure;
|
|||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
class EnsureIsTinfoilClient
|
class EnsureIsTinfoilClient
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
|
||||||
* @param Closure(Request): (Response|RedirectResponse) $next
|
* @param Closure(Request): (Response|RedirectResponse) $next
|
||||||
* @return Response|RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function handle(Request $request, Closure $next): Response|RedirectResponse
|
public function handle(Request $request, Closure $next): Response|RedirectResponse
|
||||||
{
|
{
|
||||||
if (!!$request->header('theme')) {
|
if ((bool) $request->header('theme')) {
|
||||||
return redirect()->route('tinfoil');
|
return redirect()->route('tinfoil');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Providers\AppServiceProvider;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
App\Providers\AppServiceProvider::class,
|
AppServiceProvider::class,
|
||||||
];
|
];
|
||||||
|
|||||||
+2
-2
@@ -9,14 +9,14 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2",
|
"php": "^8.4",
|
||||||
"laravel/framework": "^12.0",
|
"laravel/framework": "^12.0",
|
||||||
"laravel/tinker": "^2.10.1"
|
"laravel/tinker": "^2.10.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fakerphp/faker": "^1.23",
|
"fakerphp/faker": "^1.23",
|
||||||
"laravel/pail": "^1.2.2",
|
"laravel/pail": "^1.2.2",
|
||||||
"laravel/pint": "^1.24",
|
"laravel/pint": "^1.29",
|
||||||
"laravel/sail": "^1.41",
|
"laravel/sail": "^1.41",
|
||||||
"mockery/mockery": "^1.6",
|
"mockery/mockery": "^1.6",
|
||||||
"nunomaduro/collision": "^8.6",
|
"nunomaduro/collision": "^8.6",
|
||||||
|
|||||||
Generated
+14
-13
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "cf274898566d29ebdc912d11f0d0a6e3",
|
"content-hash": "f10e5685efd94a89d824ca6ed03c8b85",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "brick/math",
|
"name": "brick/math",
|
||||||
@@ -6525,16 +6525,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/pint",
|
"name": "laravel/pint",
|
||||||
"version": "v1.26.0",
|
"version": "v1.29.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/pint.git",
|
"url": "https://github.com/laravel/pint.git",
|
||||||
"reference": "69dcca060ecb15e4b564af63d1f642c81a241d6f"
|
"reference": "bdec963f53172c5e36330f3a400604c69bf02d39"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/pint/zipball/69dcca060ecb15e4b564af63d1f642c81a241d6f",
|
"url": "https://api.github.com/repos/laravel/pint/zipball/bdec963f53172c5e36330f3a400604c69bf02d39",
|
||||||
"reference": "69dcca060ecb15e4b564af63d1f642c81a241d6f",
|
"reference": "bdec963f53172c5e36330f3a400604c69bf02d39",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -6545,13 +6545,14 @@
|
|||||||
"php": "^8.2.0"
|
"php": "^8.2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"friendsofphp/php-cs-fixer": "^3.90.0",
|
"friendsofphp/php-cs-fixer": "^3.94.2",
|
||||||
"illuminate/view": "^12.40.1",
|
"illuminate/view": "^12.54.1",
|
||||||
"larastan/larastan": "^3.8.0",
|
"larastan/larastan": "^3.9.3",
|
||||||
"laravel-zero/framework": "^12.0.4",
|
"laravel-zero/framework": "^12.0.5",
|
||||||
"mockery/mockery": "^1.6.12",
|
"mockery/mockery": "^1.6.12",
|
||||||
"nunomaduro/termwind": "^2.3.3",
|
"nunomaduro/termwind": "^2.4.0",
|
||||||
"pestphp/pest": "^3.8.4"
|
"pestphp/pest": "^3.8.6",
|
||||||
|
"shipfastlabs/agent-detector": "^1.1.0"
|
||||||
},
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
"builds/pint"
|
"builds/pint"
|
||||||
@@ -6588,7 +6589,7 @@
|
|||||||
"issues": "https://github.com/laravel/pint/issues",
|
"issues": "https://github.com/laravel/pint/issues",
|
||||||
"source": "https://github.com/laravel/pint"
|
"source": "https://github.com/laravel/pint"
|
||||||
},
|
},
|
||||||
"time": "2025-11-25T21:15:52+00:00"
|
"time": "2026-03-12T15:51:39+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/sail",
|
"name": "laravel/sail",
|
||||||
@@ -9339,7 +9340,7 @@
|
|||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "^8.2"
|
"php": "^8.4"
|
||||||
},
|
},
|
||||||
"platform-dev": {},
|
"platform-dev": {},
|
||||||
"plugin-api-version": "2.9.0"
|
"plugin-api-version": "2.9.0"
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -62,7 +64,7 @@ return [
|
|||||||
'providers' => [
|
'providers' => [
|
||||||
'users' => [
|
'users' => [
|
||||||
'driver' => 'eloquent',
|
'driver' => 'eloquent',
|
||||||
'model' => env('AUTH_MODEL', App\Models\User::class),
|
'model' => env('AUTH_MODEL', User::class),
|
||||||
],
|
],
|
||||||
|
|
||||||
// 'users' => [
|
// 'users' => [
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
use Pdo\Mysql;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
@@ -59,7 +60,7 @@ return [
|
|||||||
'strict' => true,
|
'strict' => true,
|
||||||
'engine' => null,
|
'engine' => null,
|
||||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||||
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
(PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||||
]) : [],
|
]) : [],
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ return [
|
|||||||
'strict' => true,
|
'strict' => true,
|
||||||
'engine' => null,
|
'engine' => null,
|
||||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||||
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
(PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||||
]) : [],
|
]) : [],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\DBI\IndexController as DBIIndexController;
|
||||||
|
use App\Http\Controllers\Tinfoil\IndexController as TinfoilIndexController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -7,9 +9,9 @@ use Illuminate\Support\Facades\Route;
|
|||||||
| API Routes
|
| API Routes
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
Route::get('tinfoil', \App\Http\Controllers\Tinfoil\IndexController::class)
|
Route::get('tinfoil', TinfoilIndexController::class)
|
||||||
->name('tinfoil');
|
->name('tinfoil');
|
||||||
|
|
||||||
Route::get('dbi/{path?}', \App\Http\Controllers\DBI\IndexController::class)
|
Route::get('dbi/{path?}', DBIIndexController::class)
|
||||||
->where('path', '.*')
|
->where('path', '.*')
|
||||||
->name('dbi');
|
->name('dbi');
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
|
|
||||||
Route::view('/', 'welcome')->middleware([
|
Route::view('/', 'welcome')->middleware([
|
||||||
EnsureIsDbiClient::class,
|
EnsureIsDbiClient::class,
|
||||||
EnsureIsTinfoilClient::class
|
EnsureIsTinfoilClient::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Route::get('/docs/{page}', function ($page) {
|
Route::get('/docs/{page}', function ($page) {
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Test Case
|
| Test Case
|
||||||
@@ -11,7 +13,7 @@
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pest()->extend(Tests\TestCase::class)
|
pest()->extend(TestCase::class)
|
||||||
// ->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
|
// ->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
|
||||||
->in('Feature');
|
->in('Feature');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user