Compare commits
1 Commits
a169e03497
...
c392f05887
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c392f05887 |
182
.github/workflows/test.yml
vendored
182
.github/workflows/test.yml
vendored
@@ -13,17 +13,15 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout action-module-install
|
- name: Checkout action-module-install
|
||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: action-module-install
|
path: action-module-install
|
||||||
|
|
||||||
- name: Checkout action-server-install
|
- name: Clone action-server-install
|
||||||
uses: actions/checkout@v6.0.2
|
run: |
|
||||||
with:
|
git clone https://git.ktrix.dev/Nodarx/action-server-install action-server-install
|
||||||
repository: Nodarx/action-server-install
|
cd action-server-install
|
||||||
ref: main
|
git checkout main
|
||||||
path: action-server-install
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Setup server environment
|
- name: Setup server environment
|
||||||
uses: ./action-server-install
|
uses: ./action-server-install
|
||||||
@@ -105,6 +103,126 @@ jobs:
|
|||||||
|
|
||||||
echo "✓ Single module installation verified"
|
echo "✓ Single module installation verified"
|
||||||
|
|
||||||
|
# Test modules with linear dependencies
|
||||||
|
test-linear-dependencies:
|
||||||
|
name: Linear Dependencies (A → B → C)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout action-module-install
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: action-module-install
|
||||||
|
|
||||||
|
- name: Clone action-server-install
|
||||||
|
run: |
|
||||||
|
git clone https://git.ktrix.dev/Nodarx/action-server-install action-server-install
|
||||||
|
cd action-server-install
|
||||||
|
git checkout main
|
||||||
|
|
||||||
|
- name: Setup server environment
|
||||||
|
uses: ./action-server-install
|
||||||
|
with:
|
||||||
|
install-php: 'true'
|
||||||
|
php-version: '8.5'
|
||||||
|
server-path: './server'
|
||||||
|
|
||||||
|
- name: Create test repositories
|
||||||
|
run: |
|
||||||
|
# Create module-a (no dependencies)
|
||||||
|
mkdir -p /tmp/test-repos/module-a
|
||||||
|
cd /tmp/test-repos/module-a
|
||||||
|
git init
|
||||||
|
git config user.email "test@example.com"
|
||||||
|
git config user.name "Test User"
|
||||||
|
cat > composer.json << 'EOF'
|
||||||
|
{
|
||||||
|
"name": "test/module-a",
|
||||||
|
"description": "Module A",
|
||||||
|
"require": {}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
git add . && git commit -m "Initial commit"
|
||||||
|
|
||||||
|
# Create module-b (depends on module-a)
|
||||||
|
mkdir -p /tmp/test-repos/module-b
|
||||||
|
cd /tmp/test-repos/module-b
|
||||||
|
git init
|
||||||
|
git config user.email "test@example.com"
|
||||||
|
git config user.name "Test User"
|
||||||
|
cat > composer.json << 'EOF'
|
||||||
|
{
|
||||||
|
"name": "test/module-b",
|
||||||
|
"description": "Module B",
|
||||||
|
"require": {}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
git add . && git commit -m "Initial commit"
|
||||||
|
|
||||||
|
# Create module-c (depends on module-b)
|
||||||
|
mkdir -p /tmp/test-repos/module-c
|
||||||
|
cd /tmp/test-repos/module-c
|
||||||
|
git init
|
||||||
|
git config user.email "test@example.com"
|
||||||
|
git config user.name "Test User"
|
||||||
|
cat > composer.json << 'EOF'
|
||||||
|
{
|
||||||
|
"name": "test/module-c",
|
||||||
|
"description": "Module C",
|
||||||
|
"require": {}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
git add . && git commit -m "Initial commit"
|
||||||
|
|
||||||
|
- name: Install modules with dependencies
|
||||||
|
id: install
|
||||||
|
uses: ./action-module-install
|
||||||
|
with:
|
||||||
|
modules: |
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "module-c",
|
||||||
|
"repo": "file:///tmp/test-repos/module-c",
|
||||||
|
"dependencies": ["module-b"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "module-a",
|
||||||
|
"repo": "file:///tmp/test-repos/module-a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "module-b",
|
||||||
|
"repo": "file:///tmp/test-repos/module-b",
|
||||||
|
"dependencies": ["module-a"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
- name: Verify dependency order
|
||||||
|
run: |
|
||||||
|
INSTALLED="${{ steps.install.outputs.installed-modules }}"
|
||||||
|
echo "Installation order: $INSTALLED"
|
||||||
|
|
||||||
|
# Verify all modules installed
|
||||||
|
for module in module-a module-b module-c; do
|
||||||
|
if [ ! -d "./modules/$module" ]; then
|
||||||
|
echo "::error::Module $module not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "./modules/$module/vendor" ]; then
|
||||||
|
echo "::error::Composer dependencies not installed for $module"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Verify order: module-a must come before module-b, module-b before module-c
|
||||||
|
echo "$INSTALLED" | grep -E "(module-a.*module-b.*module-c|module-a.*module-c)" || {
|
||||||
|
echo "::error::Installation order is incorrect: $INSTALLED"
|
||||||
|
echo "Expected: module-a installed before module-b and module-c"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "✓ Linear dependency installation verified"
|
||||||
|
|
||||||
# Test PHP module
|
# Test PHP module
|
||||||
test-php-module:
|
test-php-module:
|
||||||
name: PHP Module with Composer
|
name: PHP Module with Composer
|
||||||
@@ -112,17 +230,15 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout action-module-install
|
- name: Checkout action-module-install
|
||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: action-module-install
|
path: action-module-install
|
||||||
|
|
||||||
- name: Clone action-server-install
|
- name: Clone action-server-install
|
||||||
uses: actions/checkout@v6.0.2
|
run: |
|
||||||
with:
|
git clone https://git.ktrix.dev/Nodarx/action-server-install action-server-install
|
||||||
repository: Nodarx/action-server-install
|
cd action-server-install
|
||||||
ref: main
|
git checkout main
|
||||||
path: action-server-install
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Setup PHP environment
|
- name: Setup PHP environment
|
||||||
uses: ./action-server-install
|
uses: ./action-server-install
|
||||||
@@ -208,17 +324,15 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout action-module-install
|
- name: Checkout action-module-install
|
||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: action-module-install
|
path: action-module-install
|
||||||
|
|
||||||
- name: Clone action-server-install
|
- name: Clone action-server-install
|
||||||
uses: actions/checkout@v6.0.2
|
run: |
|
||||||
with:
|
git clone https://git.ktrix.dev/Nodarx/action-server-install action-server-install
|
||||||
repository: Nodarx/action-server-install
|
cd action-server-install
|
||||||
ref: main
|
git checkout main
|
||||||
path: action-server-install
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: ./action-server-install
|
uses: ./action-server-install
|
||||||
@@ -291,17 +405,15 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout action-module-install
|
- name: Checkout action-module-install
|
||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: action-module-install
|
path: action-module-install
|
||||||
|
|
||||||
- name: Clone action-server-install
|
- name: Clone action-server-install
|
||||||
uses: actions/checkout@v6.0.2
|
run: |
|
||||||
with:
|
git clone https://git.ktrix.dev/Nodarx/action-server-install action-server-install
|
||||||
repository: Nodarx/action-server-install
|
cd action-server-install
|
||||||
ref: main
|
git checkout main
|
||||||
path: action-server-install
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Setup both PHP and Node.js
|
- name: Setup both PHP and Node.js
|
||||||
uses: ./action-server-install
|
uses: ./action-server-install
|
||||||
@@ -381,17 +493,15 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout action-module-install
|
- name: Checkout action-module-install
|
||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: action-module-install
|
path: action-module-install
|
||||||
|
|
||||||
- name: Clone action-server-install
|
- name: Clone action-server-install
|
||||||
uses: actions/checkout@v6.0.2
|
run: |
|
||||||
with:
|
git clone https://git.ktrix.dev/Nodarx/action-server-install action-server-install
|
||||||
repository: Nodarx/action-server-install
|
cd action-server-install
|
||||||
ref: main
|
git checkout main
|
||||||
path: action-server-install
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Setup environment
|
- name: Setup environment
|
||||||
uses: ./action-server-install
|
uses: ./action-server-install
|
||||||
|
|||||||
Reference in New Issue
Block a user