Merge pull request 'fix: tests' (#3) from fix/tests into main
Test Action / Test Build Command (push) Has been cancelled
Test Action / Test Custom Server Path (push) Has been cancelled
Test Action / Test All Components (push) Has been cancelled
Test Action / Test nginx (push) Has been cancelled
Test Action / Test PHP (push) Has been cancelled
Test Action / Test Database Configuration (push) Has been cancelled
Test Action / Test Node (push) Has been cancelled
Test Action / Test Base Modules Installation (push) Has been cancelled
Test Action / Test Base Modules Requires PHP (push) Has been cancelled

Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
2026-07-23 04:12:40 +00:00
3 changed files with 84 additions and 12 deletions
+43
View File
@@ -5,6 +5,13 @@ on:
pull_request:
branches: [ main ]
# Keep the fixture source in one place. Override these with repository variables
# when testing another server repository; no workflow edits are required.
env:
TEST_SERVER_REPOSITORY: ${{ vars.TEST_SERVER_REPOSITORY || 'Nodarx/server' }}
TEST_SERVER_REF: ${{ vars.TEST_SERVER_REF || 'main' }}
TEST_GIT_SERVER_URL: ${{ vars.TEST_GIT_SERVER_URL || 'https://git.ktrix.dev' }}
jobs:
test-node:
name: Test Node
@@ -18,6 +25,10 @@ jobs:
install-node: 'true'
node-version: '24'
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 installation
run: |
@@ -44,6 +55,10 @@ jobs:
install-php: 'true'
php-version: '8.5'
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 installation
run: |
@@ -79,6 +94,10 @@ jobs:
database-uri: 'mongodb://127.0.0.1:27017/?tls=false'
database-name: 'ktrix_ci'
app-environment: 'test'
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 configuration was written
run: |
@@ -119,6 +138,10 @@ jobs:
database-uri: 'mongodb://127.0.0.1:27017/?tls=false'
database-name: 'ktrix_ci'
install-base-modules: 'true'
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 password authentication provider is installed and enabled
run: |
@@ -152,6 +175,10 @@ jobs:
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
run: |
@@ -172,6 +199,10 @@ jobs:
with:
install-nginx: '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 installation
run: |
@@ -198,6 +229,10 @@ jobs:
node-version: '24'
php-version: '8.5'
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 installation
run: |
@@ -232,6 +267,10 @@ jobs:
with:
install-node: 'true'
server-path: './my-custom-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 installation
run: |
@@ -260,6 +299,10 @@ jobs:
install-node: 'true'
server-path: './test-server'
build-command: 'echo "Build complete" > build.log'
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 build
run: |
+20 -1
View File
@@ -223,7 +223,11 @@ Overrides are written into the checked-out `config/system.php`. Requires `instal
### Base Modules
Delegates cloning to [action-module-install](https://git.ktrix.dev/Nodarx/action-module-install), then installs and enables the module via `bin/console`. Requires `install-php` and a reachable, configured database.
Clones the configured module repository directly, then installs and enables the
module via `bin/console`. This avoids a nested remote-action dependency, so the
action works on GitHub-compatible hosts without resolving
`Nodarx/action-module-install` through GitHub. Requires `install-php` and a
reachable, configured database.
| Input | Description | Required | Default |
|-------|-------------|----------|---------|
@@ -231,6 +235,21 @@ Delegates cloning to [action-module-install](https://git.ktrix.dev/Nodarx/action
| `base-modules-repository` | Repository URL for the password authentication provider module | No | `https://git.ktrix.dev/Nodarx/authentication_provider_password` |
| `base-modules-branch` | Branch, tag, or commit to check out for the password authentication provider module | No | `main` |
## Testing Against Another Source
The action's test workflow keeps its server fixture source in repository
variables. The defaults target `Nodarx/server` on `https://git.ktrix.dev`.
To test another source without editing the workflow, set:
| Repository variable | Purpose | Default |
|---------------------|---------|---------|
| `TEST_SERVER_REPOSITORY` | Repository in `owner/name` form | `Nodarx/server` |
| `TEST_SERVER_REF` | Branch, tag, or commit | `main` |
| `TEST_GIT_SERVER_URL` | Base URL of the GitHub-compatible server | `https://git.ktrix.dev` |
For a private source, also add a repository secret named
`TEST_SERVER_TOKEN`. Public repositories do not require the secret.
## Outputs
| Output | Description |
+21 -11
View File
@@ -268,17 +268,27 @@ runs:
- name: Clone base modules
if: inputs.install-base-modules == 'true'
uses: Nodarx/action-module-install@main
with:
modules: |
[
{
"name": "authentication_provider_password",
"repo": "${{ inputs.base-modules-repository }}",
"branch": "${{ inputs.base-modules-branch }}"
}
]
install-path: ${{ inputs.server-path }}/modules
shell: bash
env:
MODULE_REPOSITORY: ${{ inputs.base-modules-repository }}
MODULE_REF: ${{ inputs.base-modules-branch }}
MODULE_PATH: ${{ inputs.server-path }}/modules/authentication_provider_password
run: |
echo "::group::Cloning base modules"
if [ -e "$MODULE_PATH" ]; then
echo "::error::Base module path already exists: $MODULE_PATH"
exit 1
fi
mkdir -p "$(dirname "$MODULE_PATH")"
git init "$MODULE_PATH"
git -C "$MODULE_PATH" remote add origin "$MODULE_REPOSITORY"
git -C "$MODULE_PATH" fetch --depth 1 origin "$MODULE_REF"
git -C "$MODULE_PATH" checkout --detach FETCH_HEAD
echo "✓ Base modules cloned"
echo "::endgroup::"
- name: Install and enable base modules
if: inputs.install-base-modules == 'true'