All checks were successful
Test Action / Test Node (pull_request) Successful in 18s
Test Action / Test Without Dependencies (pull_request) Successful in 8s
Test Action / Test nginx (pull_request) Successful in 22s
Test Action / Test Custom Server Path (pull_request) Successful in 21s
Test Action / Test Build Command (pull_request) Successful in 24s
Test Action / Test PHP (pull_request) Successful in 55s
Test Action / Test All Components (pull_request) Successful in 1m15s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
190 lines
5.2 KiB
YAML
190 lines
5.2 KiB
YAML
name: Test Action
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test-node:
|
|
name: Test Node
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Test action with Node.js (npm)
|
|
uses: ./
|
|
with:
|
|
install-node: 'true'
|
|
node-version: '24'
|
|
server-path: './test-server'
|
|
|
|
- name: Verify installation
|
|
run: |
|
|
test -d ./test-server || exit 1
|
|
test -d ./test-server/node_modules || exit 1
|
|
chmod +x ./scripts/health-check.sh
|
|
./scripts/health-check.sh ./test-server true false false
|
|
echo "✓ Node.js (npm) installation successful"
|
|
|
|
- name: Run server tests
|
|
run: |
|
|
cd ./test-server
|
|
npm run test:unit
|
|
|
|
test-php:
|
|
name: Test PHP
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Test action with PHP
|
|
uses: ./
|
|
with:
|
|
install-php: 'true'
|
|
php-version: '8.5'
|
|
server-path: './test-server'
|
|
|
|
- name: Verify installation
|
|
run: |
|
|
test -d ./test-server || exit 1
|
|
php --version
|
|
composer --version
|
|
chmod +x ./scripts/health-check.sh
|
|
./scripts/health-check.sh ./test-server false true false
|
|
echo "✓ PHP installation successful"
|
|
|
|
- name: Run server tests
|
|
run: |
|
|
cd ./test-server
|
|
composer test:unit
|
|
|
|
test-nginx:
|
|
name: Test nginx
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Test action with nginx
|
|
uses: ./
|
|
with:
|
|
install-nginx: 'true'
|
|
server-path: './test-server'
|
|
|
|
- name: Verify installation
|
|
run: |
|
|
test -d ./test-server || exit 1
|
|
nginx -v
|
|
# Verify nginx is running
|
|
pgrep nginx || exit 1
|
|
chmod +x ./scripts/health-check.sh
|
|
./scripts/health-check.sh ./test-server false false true
|
|
echo "✓ nginx installation successful"
|
|
|
|
test-all-components:
|
|
name: Test All Components
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Test action with all components
|
|
uses: ./
|
|
with:
|
|
install-node: 'true'
|
|
install-php: 'true'
|
|
install-nginx: 'true'
|
|
node-version: '24'
|
|
php-version: '8.5'
|
|
server-path: './test-server'
|
|
|
|
- name: Verify installation
|
|
run: |
|
|
test -d ./test-server || exit 1
|
|
test -d ./test-server/node_modules || exit 1
|
|
node --version
|
|
npm --version
|
|
php --version
|
|
composer --version
|
|
nginx -v
|
|
chmod +x ./scripts/health-check.sh
|
|
./scripts/health-check.sh ./test-server true true true
|
|
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:
|
|
name: Test Custom Server Path
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Test action with custom path
|
|
uses: ./
|
|
with:
|
|
install-node: 'true'
|
|
server-path: './my-custom-server'
|
|
|
|
- name: Verify installation
|
|
run: |
|
|
test -d ./my-custom-server || exit 1
|
|
test -d ./my-custom-server/node_modules || exit 1
|
|
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-without-dependencies:
|
|
name: Test Without Dependencies
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Test action without installing dependencies
|
|
uses: ./
|
|
with:
|
|
install-node: 'true'
|
|
install-dependencies: 'false'
|
|
server-path: './test-server'
|
|
|
|
- name: Verify installation
|
|
run: |
|
|
test -d ./test-server || exit 1
|
|
node --version
|
|
# node_modules should not exist since we skipped dependency installation
|
|
if [ -d ./test-server/node_modules ]; then
|
|
echo "✗ Dependencies were installed when they shouldn't have been"
|
|
exit 1
|
|
fi
|
|
echo "✓ Installation without dependencies successful"
|
|
|
|
test-build-command:
|
|
name: Test Build Command
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6.0.2
|
|
|
|
- name: Test action with build command
|
|
uses: ./
|
|
with:
|
|
install-node: 'true'
|
|
server-path: './test-server'
|
|
build-command: 'echo "Build complete" > build.log'
|
|
|
|
- name: Verify build
|
|
run: |
|
|
cd ./test-server
|
|
npm run dev
|