From 6c1fad375538ee7bf974b60c317db2b9cfab51e4 Mon Sep 17 00:00:00 2001 From: Nicholas Avenell Date: Tue, 28 Jul 2026 22:03:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=87=20Add=20optional=20setup=5Fcommand?= =?UTF-8?q?=20input=20to=20Laravel=20test=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consumer repos sometimes need app-specific setup (e.g. generating Passport RSA keys) after the environment is prepared but before tests run. Adds a new no-op-by-default setup_command input instead of forcing consumers to prefix their test_command. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/laravel-tests.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/laravel-tests.yml b/.github/workflows/laravel-tests.yml index 4eea6e0..541d83f 100644 --- a/.github/workflows/laravel-tests.yml +++ b/.github/workflows/laravel-tests.yml @@ -19,6 +19,10 @@ on: test_command: type: string default: "vendor/bin/phpunit" + setup_command: + description: "Extra shell command to run after the environment is prepared (DB, keys, permissions) but before tests run. Useful for app-specific setup like `php artisan passport:keys --force`." + type: string + default: "" environment: description: "GitHub environment name for environment-scoped variables/secrets. Leave empty to avoid registering a deployment." type: string @@ -84,6 +88,10 @@ jobs: mkdir -p database touch database/database.sqlite + - name: Run setup command + if: inputs.setup_command != '' + run: ${{ inputs.setup_command }} + - name: Run tests env: DB_CONNECTION: sqlite @@ -162,6 +170,10 @@ jobs: mkdir -p database touch database/database.sqlite + - name: Run setup command + if: inputs.setup_command != '' + run: ${{ inputs.setup_command }} + - name: Run migrations run: php artisan migrate --env=testing --force env: