From fe79deb183fb5279e88beead7603609311f975bc Mon Sep 17 00:00:00 2001 From: Sebastian Krupinski Date: Thu, 23 Jul 2026 00:02:45 -0400 Subject: [PATCH] fix: tests Signed-off-by: Sebastian Krupinski --- .github/workflows/test.yml | 43 ++++++++++++++++++++++++++++++++++++++ README.md | 15 +++++++++++++ 2 files changed, 58 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd94f16..b6e12b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: | diff --git a/README.md b/README.md index b6a1146..1c8df1d 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,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 |