Compare commits
1 Commits
main
...
58cd5d025e
| Author | SHA1 | Date | |
|---|---|---|---|
| 58cd5d025e |
24
.github/workflows/test.yml
vendored
24
.github/workflows/test.yml
vendored
@@ -146,6 +146,30 @@ jobs:
|
|||||||
echo "⚠ No test script configured, skipping"
|
echo "⚠ No test script configured, skipping"
|
||||||
fi
|
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:
|
test-build-command:
|
||||||
name: Test Build Command
|
name: Test Build Command
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
54
action.yml
54
action.yml
@@ -51,22 +51,6 @@ inputs:
|
|||||||
description: 'Custom script to run after installation'
|
description: 'Custom script to run after installation'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
server-repository:
|
|
||||||
description: 'Repository to checkout for the server source'
|
|
||||||
required: false
|
|
||||||
default: 'Nodarx/server'
|
|
||||||
server-ref:
|
|
||||||
description: 'Branch, tag, or SHA to checkout for the server repository'
|
|
||||||
required: false
|
|
||||||
default: 'main'
|
|
||||||
github-server-url:
|
|
||||||
description: 'Git server base URL for checkout (e.g. https://git.ktrix.dev)'
|
|
||||||
required: false
|
|
||||||
default: 'https://git.ktrix.dev'
|
|
||||||
checkout-token:
|
|
||||||
description: 'Optional token for private/external repository checkout'
|
|
||||||
required: false
|
|
||||||
default: ''
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
install-status:
|
install-status:
|
||||||
@@ -109,28 +93,22 @@ runs:
|
|||||||
echo "Install dependencies: ${{ inputs.install-dependencies }}"
|
echo "Install dependencies: ${{ inputs.install-dependencies }}"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
- name: Checkout server repository (public/no token)
|
- name: Clone server repository
|
||||||
if: inputs.checkout-token == ''
|
shell: bash
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
with:
|
echo "::group::Cloning Nodarx server repository"
|
||||||
repository: ${{ inputs.server-repository }}
|
|
||||||
ref: ${{ inputs.server-ref }}
|
|
||||||
path: ${{ inputs.server-path }}
|
|
||||||
fetch-depth: 1
|
|
||||||
submodules: recursive
|
|
||||||
github-server-url: ${{ inputs.github-server-url }}
|
|
||||||
|
|
||||||
- name: Checkout server repository (with token)
|
if [ -d "${{ inputs.server-path }}" ]; then
|
||||||
if: inputs.checkout-token != ''
|
echo "Directory exists, pulling latest changes..."
|
||||||
uses: actions/checkout@v4
|
cd "${{ inputs.server-path }}"
|
||||||
with:
|
git pull --recurse-submodules || echo "::warning::Pull failed, continuing with existing code"
|
||||||
repository: ${{ inputs.server-repository }}
|
else
|
||||||
ref: ${{ inputs.server-ref }}
|
echo "Cloning repository..."
|
||||||
path: ${{ inputs.server-path }}
|
git clone --recurse-submodules --depth 1 https://git.ktrix.dev/Nodarx/server "${{ inputs.server-path }}"
|
||||||
fetch-depth: 1
|
fi
|
||||||
submodules: recursive
|
|
||||||
github-server-url: ${{ inputs.github-server-url }}
|
echo "Repository cloned/updated successfully"
|
||||||
token: ${{ inputs.checkout-token }}
|
echo "::endgroup::"
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
if: inputs.install-node == 'true'
|
if: inputs.install-node == 'true'
|
||||||
@@ -140,7 +118,7 @@ runs:
|
|||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
if: inputs.install-php == 'true'
|
if: inputs.install-php == 'true'
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2.36.0
|
||||||
with:
|
with:
|
||||||
php-version: ${{ inputs.php-version }}
|
php-version: ${{ inputs.php-version }}
|
||||||
extensions: ${{ inputs.php-extensions }}
|
extensions: ${{ inputs.php-extensions }}
|
||||||
|
|||||||
Reference in New Issue
Block a user