fix: test hang
Test Action / Test PHP (pull_request) Successful in 42s
Test Action / Test Base Modules Requires PHP (pull_request) Successful in 9s
Test Action / Test Build Command (pull_request) Successful in 52s
Test Action / Test Node (pull_request) Failing after 52s
Test Action / Test Custom Server Path (pull_request) Failing after 54s
Test Action / Test nginx (pull_request) Successful in 1m7s
Test Action / Test Database Configuration (pull_request) Successful in 1m35s
Test Action / Test Base Modules Installation (pull_request) Successful in 1m40s
Test Action / Test All Components (pull_request) Successful in 2m8s
Test Action / Test PHP (pull_request) Successful in 42s
Test Action / Test Base Modules Requires PHP (pull_request) Successful in 9s
Test Action / Test Build Command (pull_request) Successful in 52s
Test Action / Test Node (pull_request) Failing after 52s
Test Action / Test Custom Server Path (pull_request) Failing after 54s
Test Action / Test nginx (pull_request) Successful in 1m7s
Test Action / Test Database Configuration (pull_request) Successful in 1m35s
Test Action / Test Base Modules Installation (pull_request) Successful in 1m40s
Test Action / Test All Components (pull_request) Successful in 2m8s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
+33
-30
@@ -18,7 +18,9 @@ jobs:
|
|||||||
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)
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -48,7 +50,9 @@ jobs:
|
|||||||
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
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -81,10 +85,10 @@ jobs:
|
|||||||
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 database configuration
|
- name: Test action with database configuration
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -126,10 +130,10 @@ jobs:
|
|||||||
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
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -167,34 +171,25 @@ jobs:
|
|||||||
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: ./
|
||||||
@@ -220,7 +215,9 @@ 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
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -262,7 +259,9 @@ jobs:
|
|||||||
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
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -293,7 +292,9 @@ jobs:
|
|||||||
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: ./
|
||||||
@@ -309,4 +310,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"
|
||||||
|
|||||||
+7
-13
@@ -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:"
|
||||||
@@ -156,6 +148,7 @@ 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 != ''
|
||||||
@@ -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'
|
||||||
|
|||||||
@@ -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