Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 13f2e53360 |
@@ -175,26 +175,13 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- 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'
|
||||
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: |
|
||||
if [ "${{ steps.expect-failure.outcome }}" != "failure" ]; then
|
||||
echo "::error::Expected action to fail when install-base-modules is set without install-php"
|
||||
if bash ./scripts/validate-inputs.sh true false false true; then
|
||||
echo "::error::Expected validation to fail when install-base-modules is set without install-php"
|
||||
exit 1
|
||||
fi
|
||||
echo "✓ Action correctly rejected install-base-modules without install-php"
|
||||
echo "✓ Validation correctly rejected install-base-modules without install-php"
|
||||
|
||||
test-nginx:
|
||||
name: Test nginx
|
||||
|
||||
+5
-13
@@ -124,19 +124,11 @@ runs:
|
||||
run: |
|
||||
echo "::group::Validating inputs"
|
||||
|
||||
# Validate at least one component is enabled
|
||||
if [ "${{ inputs.install-node }}" != "true" ] && \
|
||||
[ "${{ inputs.install-php }}" != "true" ] && \
|
||||
[ "${{ inputs.install-nginx }}" != "true" ]; then
|
||||
echo "::error::At least one component must be enabled (install-node, install-php, or install-nginx)"
|
||||
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
|
||||
bash "${{ github.action_path }}/scripts/validate-inputs.sh" \
|
||||
"${{ inputs.install-node }}" \
|
||||
"${{ inputs.install-php }}" \
|
||||
"${{ inputs.install-nginx }}" \
|
||||
"${{ inputs.install-base-modules }}"
|
||||
|
||||
echo "Server path: ${{ inputs.server-path }}"
|
||||
echo "Components to install:"
|
||||
|
||||
@@ -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