feat: improve install action
Test Action / Test Base Modules Requires PHP (push) Failing after 10m29s
Test Action / Test Base Modules Installation (push) Failing after 10m31s
Test Action / Test Node (push) Failing after 10m37s
Test Action / Test Build Command (push) Failing after 14m37s
Test Action / Test Custom Server Path (push) Failing after 15m23s
Test Action / Test All Components (push) Failing after 15m25s
Test Action / Test nginx (push) Failing after 15m27s
Test Action / Test Database Configuration (push) Failing after 15m33s
Test Action / Test PHP (push) Failing after 15m35s
Test Action / Test Base Modules Requires PHP (push) Failing after 10m29s
Test Action / Test Base Modules Installation (push) Failing after 10m31s
Test Action / Test Node (push) Failing after 10m37s
Test Action / Test Build Command (push) Failing after 14m37s
Test Action / Test Custom Server Path (push) Failing after 15m23s
Test Action / Test All Components (push) Failing after 15m25s
Test Action / Test nginx (push) Failing after 15m27s
Test Action / Test Database Configuration (push) Failing after 15m33s
Test Action / Test PHP (push) Failing after 15m35s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -59,6 +59,108 @@ jobs:
|
||||
cd ./test-server
|
||||
composer test:unit
|
||||
|
||||
test-database-config:
|
||||
name: Test Database Configuration
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mongo:
|
||||
image: mongo:7
|
||||
ports:
|
||||
- 27017:27017
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.2
|
||||
|
||||
- name: Test action with database configuration
|
||||
uses: ./
|
||||
with:
|
||||
install-php: 'true'
|
||||
php-version: '8.5'
|
||||
server-path: './test-server'
|
||||
database-uri: 'mongodb://127.0.0.1:27017/?tls=false'
|
||||
database-name: 'ktrix_ci'
|
||||
app-environment: 'test'
|
||||
|
||||
- name: Verify configuration was written
|
||||
run: |
|
||||
cd ./test-server
|
||||
php -r '
|
||||
$config = include "config/system.php";
|
||||
$uri = $config["database"]["uri"] ?? null;
|
||||
$name = $config["database"]["database"] ?? null;
|
||||
$env = $config["environment"] ?? null;
|
||||
if ($uri !== "mongodb://127.0.0.1:27017/?tls=false") { fwrite(STDERR, "database.uri not overridden, got: $uri\n"); exit(1); }
|
||||
if ($name !== "ktrix_ci") { fwrite(STDERR, "database.database not overridden, got: $name\n"); exit(1); }
|
||||
if ($env !== "test") { fwrite(STDERR, "environment not overridden, got: $env\n"); exit(1); }
|
||||
'
|
||||
echo "✓ Database configuration verified"
|
||||
|
||||
- name: Verify database is reachable with configured settings
|
||||
run: |
|
||||
cd ./test-server
|
||||
php bin/console tenant:list
|
||||
|
||||
test-base-modules:
|
||||
name: Test Base Modules Installation
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mongo:
|
||||
image: mongo:7
|
||||
ports:
|
||||
- 27017:27017
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.2
|
||||
|
||||
- name: Test action with base modules
|
||||
uses: ./
|
||||
with:
|
||||
install-php: 'true'
|
||||
php-version: '8.5'
|
||||
server-path: './test-server'
|
||||
database-uri: 'mongodb://127.0.0.1:27017/?tls=false'
|
||||
database-name: 'ktrix_ci'
|
||||
install-base-modules: 'true'
|
||||
|
||||
- name: Verify password authentication provider is installed and enabled
|
||||
run: |
|
||||
cd ./test-server
|
||||
OUTPUT=$(php bin/console module:list)
|
||||
echo "$OUTPUT"
|
||||
echo "$OUTPUT" | grep -q "authentication_provider_password" || { echo "::error::authentication_provider_password not found in module list"; exit 1; }
|
||||
echo "$OUTPUT" | grep "authentication_provider_password" | grep -q "Enabled" || { echo "::error::authentication_provider_password is not enabled"; exit 1; }
|
||||
echo "✓ authentication_provider_password is installed and enabled"
|
||||
|
||||
- name: Verify a tenant and user can be provisioned end-to-end
|
||||
run: |
|
||||
cd ./test-server
|
||||
php bin/console tenant:create ci.test --identifier ci_smoke
|
||||
php bin/console user:create ci_smoke tester@ci.test
|
||||
php bin/console user:password ci_smoke tester@ci.test 'Sup3r-Secret!'
|
||||
php bin/console user:list ci_smoke | grep -q "tester@ci.test" || { echo "::error::provisioned user not found"; exit 1; }
|
||||
echo "✓ tenant and user provisioning verified"
|
||||
|
||||
test-base-modules-requires-php:
|
||||
name: Test Base Modules Requires PHP
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.2
|
||||
|
||||
- name: Expect failure when install-base-modules is set without install-php
|
||||
id: expect-failure
|
||||
continue-on-error: true
|
||||
uses: ./
|
||||
with:
|
||||
install-node: 'true'
|
||||
install-base-modules: 'true'
|
||||
server-path: './test-server'
|
||||
|
||||
- name: Verify the action failed
|
||||
run: |
|
||||
if [ "${{ steps.expect-failure.outcome }}" != "failure" ]; then
|
||||
echo "::error::Expected action to fail when install-base-modules is set without install-php"
|
||||
exit 1
|
||||
fi
|
||||
echo "✓ Action correctly rejected install-base-modules without install-php"
|
||||
|
||||
test-nginx:
|
||||
name: Test nginx
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user