Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Tests

on: [push]
permissions: {}
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
shellcheck:
Expand Down Expand Up @@ -62,10 +67,7 @@ jobs:
matrix:
php: [8.2, 8.3]
database:
- mariadb:10.5
- mariadb:10.11
- mariadb:11.5
- mysql:8
- mysql:9
services:
database:
Expand All @@ -80,7 +82,6 @@ jobs:
uses: actions/checkout@v4
with:
repository: pterodactyl/panel
ref: v1.11.11
path: panel

- name: Install apt dependencies
Expand Down Expand Up @@ -113,13 +114,6 @@ jobs:
echo 'WEBUSER="runner"; OWNERSHIP="runner:runner"; USERSHELL="/bin/bash";' > .blueprintrc
chmod +x blueprint.sh

- name: Setup Blueprint
working-directory: panel
run: bash blueprint.sh
env:
BLUEPRINT_ENVIRONMENT: ci
TERM: xterm-kitty #fixes tput errors

- name: Get cache directory
id: composer-cache
working-directory: panel
Expand Down Expand Up @@ -150,6 +144,13 @@ jobs:
working-directory: panel
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist

- name: Setup Blueprint
working-directory: panel
run: bash blueprint.sh
env:
BLUEPRINT_ENVIRONMENT: ci
TERM: xterm-kitty #fixes tput errors

- name: Unit tests
working-directory: panel
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Unit
Expand Down
3 changes: 2 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
use Illuminate\Database\Console\PruneCommand;
use Pterodactyl\Repositories\Eloquent\SettingsRepository;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Pterodactyl\BlueprintFramework\GetExtensionSchedules;
use Pterodactyl\Services\Telemetry\TelemetryCollectionService;
use Pterodactyl\Console\Commands\Schedule\ProcessRunnableCommand;
use Pterodactyl\Console\Commands\Maintenance\PruneOrphanedBackupsCommand;
use Pterodactyl\Console\Commands\Maintenance\CleanServiceBackupFilesCommand;

use Pterodactyl\BlueprintFramework\GetExtensionSchedules;
use Pterodactyl\Services\Telemetry\RegisterBlueprintTelemetry;
use Pterodactyl\BlueprintFramework\Libraries\ExtensionLibrary\Console\BlueprintConsoleLibrary as BlueprintExtensionLibrary;

Expand Down
2 changes: 1 addition & 1 deletion app/Transformers/Api/Client/ServerTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function getResourceName(): string
*/
public function transform(Server $server): array
{
/** @var \Pterodactyl\Services\Servers\StartupCommandService $service */
/** @var StartupCommandService $service */
$service = Container::getInstance()->make(StartupCommandService::class);

$user = $this->request->user();
Expand Down
40 changes: 23 additions & 17 deletions blueprint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,14 @@ if [[ $1 != "-bash" ]]; then
export PROGRESS_NOW=0
fi

PRINT INFO "Installing node modules.."
# Check for yarn before installing node modules..
if ! [ -x "$(command -v yarn)" ]; then
PRINT FATAL "Missing dependency \"yarn\"."
if [[ $BLUEPRINT_ENVIRONMENT != "ci" ]]; then
PRINT INFO "Installing node modules.."
# Check for yarn before installing node modules..
if ! [ -x "$(command -v yarn)" ]; then
PRINT FATAL "Missing dependency \"yarn\"."
fi
hide_progress
fi
hide_progress

if [[ $BLUEPRINT_ENVIRONMENT != "ci" ]]; then
set -eo pipefail
Expand Down Expand Up @@ -330,7 +332,7 @@ if [[ $1 != "-bash" ]]; then
((PROGRESS_NOW++))

# Run migrations if Blueprint is not running through Docker.
if [[ $DOCKER != "y" ]]; then
if [[ ( $DOCKER != "y" ) && ( $BLUEPRINT_ENVIRONMENT != "ci" ) ]]; then
PRINT INFO "Running database migrations.."
hide_progress
php artisan migrate --force
Expand All @@ -339,21 +341,25 @@ if [[ $1 != "-bash" ]]; then
((PROGRESS_NOW++))

# Seed Blueprint database records
PRINT INFO "Seeding Blueprint database records.."
php artisan db:seed --class=BlueprintSeeder --force &>> "$BLUEPRINT__DEBUG"
if [[ $BLUEPRINT_ENVIRONMENT != "ci" ]]; then
PRINT INFO "Seeding Blueprint database records.."
php artisan db:seed --class=BlueprintSeeder --force &>> "$BLUEPRINT__DEBUG"
fi

((PROGRESS_NOW++))

# Flush cache.
PRINT INFO "Flushing cache.."
{
php artisan view:cache
php artisan config:cache
php artisan route:clear
php artisan cache:clear
php artisan bp:cache
php artisan bp:version:cache
} &>> "$BLUEPRINT__DEBUG"
if [[ $BLUEPRINT_ENVIRONMENT != "ci" ]]; then
PRINT INFO "Flushing cache.."
{
php artisan view:cache
php artisan config:cache
php artisan route:clear
php artisan cache:clear
php artisan bp:cache
php artisan bp:version:cache
} &>> "$BLUEPRINT__DEBUG"
fi

((PROGRESS_NOW++))

Expand Down