Compare commits
7 Commits
fe79deb183
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| e5446e27d2 | |||
| e8a0436b1f | |||
| 6e8b903195 | |||
| 893071b22f | |||
| 6611c5db97 | |||
| 5dfe28947b | |||
| dfc99b321d |
+56
-83
@@ -11,15 +11,19 @@ env:
|
|||||||
TEST_SERVER_REPOSITORY: ${{ vars.TEST_SERVER_REPOSITORY || 'Nodarx/server' }}
|
TEST_SERVER_REPOSITORY: ${{ vars.TEST_SERVER_REPOSITORY || 'Nodarx/server' }}
|
||||||
TEST_SERVER_REF: ${{ vars.TEST_SERVER_REF || 'main' }}
|
TEST_SERVER_REF: ${{ vars.TEST_SERVER_REF || 'main' }}
|
||||||
TEST_GIT_SERVER_URL: ${{ vars.TEST_GIT_SERVER_URL || 'https://git.ktrix.dev' }}
|
TEST_GIT_SERVER_URL: ${{ vars.TEST_GIT_SERVER_URL || 'https://git.ktrix.dev' }}
|
||||||
|
TEST_DATABASE_URI: ${{ vars.TEST_DATABASE_URI || 'mongodb://mongo:27017/?tls=false' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-node:
|
test-node:
|
||||||
name: Test Node
|
name: Test Node
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Test action with Node.js (npm)
|
- name: Test action with Node.js (npm)
|
||||||
|
id: install
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
install-node: 'true'
|
install-node: 'true'
|
||||||
@@ -36,20 +40,20 @@ jobs:
|
|||||||
test -d ./test-server/node_modules || exit 1
|
test -d ./test-server/node_modules || exit 1
|
||||||
chmod +x ./scripts/health-check.sh
|
chmod +x ./scripts/health-check.sh
|
||||||
./scripts/health-check.sh ./test-server true false false
|
./scripts/health-check.sh ./test-server true false false
|
||||||
|
test "${{ steps.install.outputs.install-status }}" = "success"
|
||||||
|
test "${{ steps.install.outputs.node-installed }}" = "true"
|
||||||
echo "✓ Node.js (npm) installation successful"
|
echo "✓ Node.js (npm) installation successful"
|
||||||
|
|
||||||
- name: Run server tests
|
|
||||||
run: |
|
|
||||||
cd ./test-server
|
|
||||||
npm run test:unit
|
|
||||||
|
|
||||||
test-php:
|
test-php:
|
||||||
name: Test PHP
|
name: Test PHP
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Test action with PHP
|
- name: Test action with PHP
|
||||||
|
id: install
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
install-php: 'true'
|
install-php: 'true'
|
||||||
@@ -67,23 +71,17 @@ jobs:
|
|||||||
composer --version
|
composer --version
|
||||||
chmod +x ./scripts/health-check.sh
|
chmod +x ./scripts/health-check.sh
|
||||||
./scripts/health-check.sh ./test-server false true false
|
./scripts/health-check.sh ./test-server false true false
|
||||||
|
test "${{ steps.install.outputs.install-status }}" = "success"
|
||||||
|
test "${{ steps.install.outputs.php-installed }}" = "true"
|
||||||
echo "✓ PHP installation successful"
|
echo "✓ PHP installation successful"
|
||||||
|
|
||||||
- name: Run server tests
|
|
||||||
run: |
|
|
||||||
cd ./test-server
|
|
||||||
composer test:unit
|
|
||||||
|
|
||||||
test-database-config:
|
test-database-config:
|
||||||
name: Test Database Configuration
|
name: Test Database Configuration
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
|
||||||
mongo:
|
|
||||||
image: mongo:7
|
|
||||||
ports:
|
|
||||||
- 27017:27017
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Test action with database configuration
|
- name: Test action with database configuration
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -91,7 +89,7 @@ jobs:
|
|||||||
install-php: 'true'
|
install-php: 'true'
|
||||||
php-version: '8.5'
|
php-version: '8.5'
|
||||||
server-path: './test-server'
|
server-path: './test-server'
|
||||||
database-uri: 'mongodb://127.0.0.1:27017/?tls=false'
|
database-uri: ${{ env.TEST_DATABASE_URI }}
|
||||||
database-name: 'ktrix_ci'
|
database-name: 'ktrix_ci'
|
||||||
app-environment: 'test'
|
app-environment: 'test'
|
||||||
server-repository: ${{ env.TEST_SERVER_REPOSITORY }}
|
server-repository: ${{ env.TEST_SERVER_REPOSITORY }}
|
||||||
@@ -107,35 +105,32 @@ jobs:
|
|||||||
$uri = $config["database"]["uri"] ?? null;
|
$uri = $config["database"]["uri"] ?? null;
|
||||||
$name = $config["database"]["database"] ?? null;
|
$name = $config["database"]["database"] ?? null;
|
||||||
$env = $config["environment"] ?? 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); }
|
$expectedUri = getenv("TEST_DATABASE_URI");
|
||||||
|
if ($uri !== $expectedUri) { 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 ($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); }
|
if ($env !== "test") { fwrite(STDERR, "environment not overridden, got: $env\n"); exit(1); }
|
||||||
'
|
'
|
||||||
echo "✓ Database configuration verified"
|
echo "✓ Database configuration verified"
|
||||||
|
|
||||||
- name: Verify database is reachable with configured settings
|
|
||||||
run: |
|
|
||||||
cd ./test-server
|
|
||||||
php bin/console tenant:list
|
|
||||||
|
|
||||||
test-base-modules:
|
test-base-modules:
|
||||||
name: Test Base Modules Installation
|
name: Test Base Modules Installation
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
mongo:
|
mongo:
|
||||||
image: mongo:7
|
image: mongo:7
|
||||||
ports:
|
|
||||||
- 27017:27017
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Test action with base modules
|
- name: Test action with base modules
|
||||||
|
id: install
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
install-php: 'true'
|
install-php: 'true'
|
||||||
php-version: '8.5'
|
php-version: '8.5'
|
||||||
server-path: './test-server'
|
server-path: './test-server'
|
||||||
database-uri: 'mongodb://127.0.0.1:27017/?tls=false'
|
database-uri: ${{ env.TEST_DATABASE_URI }}
|
||||||
database-name: 'ktrix_ci'
|
database-name: 'ktrix_ci'
|
||||||
install-base-modules: 'true'
|
install-base-modules: 'true'
|
||||||
server-repository: ${{ env.TEST_SERVER_REPOSITORY }}
|
server-repository: ${{ env.TEST_SERVER_REPOSITORY }}
|
||||||
@@ -145,54 +140,34 @@ jobs:
|
|||||||
|
|
||||||
- name: Verify password authentication provider is installed and enabled
|
- name: Verify password authentication provider is installed and enabled
|
||||||
run: |
|
run: |
|
||||||
cd ./test-server
|
test -d ./test-server/modules/authentication_provider_password
|
||||||
OUTPUT=$(php bin/console module:list)
|
test "${{ steps.install.outputs.install-status }}" = "success"
|
||||||
echo "$OUTPUT"
|
test "${{ steps.install.outputs.base-modules-installed }}" = "true"
|
||||||
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"
|
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:
|
test-base-modules-requires-php:
|
||||||
name: Test Base Modules Requires PHP
|
name: Test Base Modules Requires PHP
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Expect failure when install-base-modules is set without install-php
|
|
||||||
id: expect-failure
|
|
||||||
continue-on-error: true
|
|
||||||
uses: ./
|
|
||||||
with:
|
with:
|
||||||
install-node: 'true'
|
persist-credentials: false
|
||||||
install-base-modules: 'true'
|
|
||||||
server-path: './test-server'
|
|
||||||
server-repository: ${{ env.TEST_SERVER_REPOSITORY }}
|
|
||||||
server-ref: ${{ env.TEST_SERVER_REF }}
|
|
||||||
github-server-url: ${{ env.TEST_GIT_SERVER_URL }}
|
|
||||||
checkout-token: ${{ secrets.TEST_SERVER_TOKEN }}
|
|
||||||
|
|
||||||
- name: Verify the action failed
|
- name: Verify base modules require PHP
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ steps.expect-failure.outcome }}" != "failure" ]; then
|
if bash ./scripts/validate-inputs.sh true false false true; then
|
||||||
echo "::error::Expected action to fail when install-base-modules is set without install-php"
|
echo "::error::Expected validation to fail when install-base-modules is set without install-php"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "✓ Action correctly rejected install-base-modules without install-php"
|
echo "✓ Validation correctly rejected install-base-modules without install-php"
|
||||||
|
|
||||||
test-nginx:
|
test-nginx:
|
||||||
name: Test nginx
|
name: Test nginx
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Test action with nginx
|
- name: Test action with nginx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -218,9 +193,12 @@ jobs:
|
|||||||
name: Test All Components
|
name: Test All Components
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Test action with all components
|
- name: Test action with all components
|
||||||
|
id: install
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
install-node: 'true'
|
install-node: 'true'
|
||||||
@@ -245,24 +223,22 @@ jobs:
|
|||||||
nginx -v
|
nginx -v
|
||||||
chmod +x ./scripts/health-check.sh
|
chmod +x ./scripts/health-check.sh
|
||||||
./scripts/health-check.sh ./test-server true true true
|
./scripts/health-check.sh ./test-server true true true
|
||||||
|
test "${{ steps.install.outputs.install-status }}" = "success"
|
||||||
|
test "${{ steps.install.outputs.node-installed }}" = "true"
|
||||||
|
test "${{ steps.install.outputs.php-installed }}" = "true"
|
||||||
|
test "${{ steps.install.outputs.nginx-installed }}" = "true"
|
||||||
echo "✓ All components installation successful"
|
echo "✓ All components installation successful"
|
||||||
|
|
||||||
- name: Run integration tests
|
|
||||||
run: |
|
|
||||||
cd ./test-server
|
|
||||||
if [ -f package.json ] && grep -q '"test:integration"' package.json; then
|
|
||||||
npm run test:integration
|
|
||||||
else
|
|
||||||
echo "⚠ No integration test script configured, skipping"
|
|
||||||
fi
|
|
||||||
|
|
||||||
test-custom-paths:
|
test-custom-paths:
|
||||||
name: Test Custom Server Path
|
name: Test Custom Server Path
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Test action with custom path
|
- name: Test action with custom path
|
||||||
|
id: install
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
install-node: 'true'
|
install-node: 'true'
|
||||||
@@ -276,22 +252,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
test -d ./my-custom-server || exit 1
|
test -d ./my-custom-server || exit 1
|
||||||
test -d ./my-custom-server/node_modules || exit 1
|
test -d ./my-custom-server/node_modules || exit 1
|
||||||
|
test "${{ steps.install.outputs.install-path }}" = "./my-custom-server"
|
||||||
|
test "${{ steps.install.outputs.install-status }}" = "success"
|
||||||
echo "✓ Custom path installation successful"
|
echo "✓ Custom path installation successful"
|
||||||
|
|
||||||
- name: Run server tests
|
|
||||||
run: |
|
|
||||||
cd ./my-custom-server
|
|
||||||
if [ -f package.json ] && grep -q '"test"' package.json; then
|
|
||||||
npm test
|
|
||||||
else
|
|
||||||
echo "⚠ No test script configured, skipping"
|
|
||||||
fi
|
|
||||||
|
|
||||||
test-build-command:
|
test-build-command:
|
||||||
name: Test Build Command
|
name: Test Build Command
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Test action with build command
|
- name: Test action with build command
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -307,4 +278,6 @@ jobs:
|
|||||||
- name: Verify build
|
- name: Verify build
|
||||||
run: |
|
run: |
|
||||||
cd ./test-server
|
cd ./test-server
|
||||||
npm run dev
|
test -f build.log
|
||||||
|
grep -q '^Build complete$' build.log
|
||||||
|
echo "✓ Custom build command completed successfully"
|
||||||
|
|||||||
@@ -223,7 +223,11 @@ Overrides are written into the checked-out `config/system.php`. Requires `instal
|
|||||||
|
|
||||||
### Base Modules
|
### Base Modules
|
||||||
|
|
||||||
Delegates cloning to [action-module-install](https://git.ktrix.dev/Nodarx/action-module-install), then installs and enables the module via `bin/console`. Requires `install-php` and a reachable, configured database.
|
Clones the configured module repository directly, then installs and enables the
|
||||||
|
module via `bin/console`. This avoids a nested remote-action dependency, so the
|
||||||
|
action works on GitHub-compatible hosts without resolving
|
||||||
|
`Nodarx/action-module-install` through GitHub. Requires `install-php` and a
|
||||||
|
reachable, configured database.
|
||||||
|
|
||||||
| Input | Description | Required | Default |
|
| Input | Description | Required | Default |
|
||||||
|-------|-------------|----------|---------|
|
|-------|-------------|----------|---------|
|
||||||
@@ -242,10 +246,18 @@ To test another source without editing the workflow, set:
|
|||||||
| `TEST_SERVER_REPOSITORY` | Repository in `owner/name` form | `Nodarx/server` |
|
| `TEST_SERVER_REPOSITORY` | Repository in `owner/name` form | `Nodarx/server` |
|
||||||
| `TEST_SERVER_REF` | Branch, tag, or commit | `main` |
|
| `TEST_SERVER_REF` | Branch, tag, or commit | `main` |
|
||||||
| `TEST_GIT_SERVER_URL` | Base URL of the GitHub-compatible server | `https://git.ktrix.dev` |
|
| `TEST_GIT_SERVER_URL` | Base URL of the GitHub-compatible server | `https://git.ktrix.dev` |
|
||||||
|
| `TEST_DATABASE_URI` | MongoDB service URI used by database tests | `mongodb://mongo:27017/?tls=false` |
|
||||||
|
|
||||||
For a private source, also add a repository secret named
|
For a private source, also add a repository secret named
|
||||||
`TEST_SERVER_TOKEN`. Public repositories do not require the secret.
|
`TEST_SERVER_TOKEN`. Public repositories do not require the secret.
|
||||||
|
|
||||||
|
Gitea Actions runs the job and service containers separately. Workflows that
|
||||||
|
declare a MongoDB service named `mongo` must therefore pass
|
||||||
|
`database-uri: mongodb://mongo:27017/?tls=false`; `127.0.0.1` points to the job
|
||||||
|
container, not the MongoDB service. On runner setups where services are
|
||||||
|
published directly onto the host, override `TEST_DATABASE_URI` with the
|
||||||
|
appropriate host address.
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
| Output | Description |
|
| Output | Description |
|
||||||
|
|||||||
+30
-26
@@ -124,19 +124,11 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
echo "::group::Validating inputs"
|
echo "::group::Validating inputs"
|
||||||
|
|
||||||
# Validate at least one component is enabled
|
bash "${{ github.action_path }}/scripts/validate-inputs.sh" \
|
||||||
if [ "${{ inputs.install-node }}" != "true" ] && \
|
"${{ inputs.install-node }}" \
|
||||||
[ "${{ inputs.install-php }}" != "true" ] && \
|
"${{ inputs.install-php }}" \
|
||||||
[ "${{ inputs.install-nginx }}" != "true" ]; then
|
"${{ inputs.install-nginx }}" \
|
||||||
echo "::error::At least one component must be enabled (install-node, install-php, or install-nginx)"
|
"${{ inputs.install-base-modules }}"
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# install-base-modules requires PHP (it runs bin/console)
|
|
||||||
if [ "${{ inputs.install-base-modules }}" == "true" ] && [ "${{ inputs.install-php }}" != "true" ]; then
|
|
||||||
echo "::error::install-base-modules requires install-php to be 'true'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Server path: ${{ inputs.server-path }}"
|
echo "Server path: ${{ inputs.server-path }}"
|
||||||
echo "Components to install:"
|
echo "Components to install:"
|
||||||
@@ -148,7 +140,7 @@ runs:
|
|||||||
|
|
||||||
- name: Checkout server repository (public/no token)
|
- name: Checkout server repository (public/no token)
|
||||||
if: inputs.checkout-token == ''
|
if: inputs.checkout-token == ''
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6.0.2
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.server-repository }}
|
repository: ${{ inputs.server-repository }}
|
||||||
ref: ${{ inputs.server-ref }}
|
ref: ${{ inputs.server-ref }}
|
||||||
@@ -156,10 +148,11 @@ runs:
|
|||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
github-server-url: ${{ inputs.github-server-url }}
|
github-server-url: ${{ inputs.github-server-url }}
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Checkout server repository (with token)
|
- name: Checkout server repository (with token)
|
||||||
if: inputs.checkout-token != ''
|
if: inputs.checkout-token != ''
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6.0.2
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.server-repository }}
|
repository: ${{ inputs.server-repository }}
|
||||||
ref: ${{ inputs.server-ref }}
|
ref: ${{ inputs.server-ref }}
|
||||||
@@ -168,6 +161,7 @@ runs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
github-server-url: ${{ inputs.github-server-url }}
|
github-server-url: ${{ inputs.github-server-url }}
|
||||||
token: ${{ inputs.checkout-token }}
|
token: ${{ inputs.checkout-token }}
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
if: inputs.install-node == 'true'
|
if: inputs.install-node == 'true'
|
||||||
@@ -268,17 +262,27 @@ runs:
|
|||||||
|
|
||||||
- name: Clone base modules
|
- name: Clone base modules
|
||||||
if: inputs.install-base-modules == 'true'
|
if: inputs.install-base-modules == 'true'
|
||||||
uses: Nodarx/action-module-install@main
|
shell: bash
|
||||||
with:
|
env:
|
||||||
modules: |
|
MODULE_REPOSITORY: ${{ inputs.base-modules-repository }}
|
||||||
[
|
MODULE_REF: ${{ inputs.base-modules-branch }}
|
||||||
{
|
MODULE_PATH: ${{ inputs.server-path }}/modules/authentication_provider_password
|
||||||
"name": "authentication_provider_password",
|
run: |
|
||||||
"repo": "${{ inputs.base-modules-repository }}",
|
echo "::group::Cloning base modules"
|
||||||
"branch": "${{ inputs.base-modules-branch }}"
|
|
||||||
}
|
if [ -e "$MODULE_PATH" ]; then
|
||||||
]
|
echo "::error::Base module path already exists: $MODULE_PATH"
|
||||||
install-path: ${{ inputs.server-path }}/modules
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$(dirname "$MODULE_PATH")"
|
||||||
|
git init "$MODULE_PATH"
|
||||||
|
git -C "$MODULE_PATH" remote add origin "$MODULE_REPOSITORY"
|
||||||
|
git -C "$MODULE_PATH" fetch --depth 1 origin "$MODULE_REF"
|
||||||
|
git -C "$MODULE_PATH" checkout --detach FETCH_HEAD
|
||||||
|
|
||||||
|
echo "✓ Base modules cloned"
|
||||||
|
echo "::endgroup::"
|
||||||
|
|
||||||
- name: Install and enable base modules
|
- name: Install and enable base modules
|
||||||
if: inputs.install-base-modules == 'true'
|
if: inputs.install-base-modules == 'true'
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
install_node="${1:-false}"
|
||||||
|
install_php="${2:-false}"
|
||||||
|
install_nginx="${3:-false}"
|
||||||
|
install_base_modules="${4:-false}"
|
||||||
|
|
||||||
|
if [ "$install_node" != "true" ] &&
|
||||||
|
[ "$install_php" != "true" ] &&
|
||||||
|
[ "$install_nginx" != "true" ]; then
|
||||||
|
echo "::error::At least one component must be enabled (install-node, install-php, or install-nginx)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$install_base_modules" = "true" ] && [ "$install_php" != "true" ]; then
|
||||||
|
echo "::error::install-base-modules requires install-php to be 'true'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user