From a9dec7a60117f93abeade0b6c67989b5d13ad67e Mon Sep 17 00:00:00 2001 From: Derek Bourgeois Date: Sun, 5 Apr 2026 01:40:33 -0400 Subject: [PATCH 1/2] test: add laravel 13 compatibility verification --- .gitattributes | 1 + .github/workflows/ci.yml | 1 + .gitignore | 1 + CONTRIBUTING.md | 3 ++ composer.json | 2 ++ scripts/test-laravel-13-compat.sh | 54 +++++++++++++++++++++++++++++++ 6 files changed, 62 insertions(+) create mode 100755 scripts/test-laravel-13-compat.sh diff --git a/.gitattributes b/.gitattributes index d8ba196..f71f939 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,5 +7,6 @@ /package.json export-ignore /phpunit.xml.dist export-ignore /.releaserc.json export-ignore +/scripts export-ignore /tests export-ignore /vendor export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f5ef14..a1b577e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,7 @@ jobs: testbench: '^11.0' composer-flags: '' experimental: false + # Laravel 13 is the current package baseline and requires PHP 8.3+. - name: Laravel 13 / PHP 8.4 php: '8.4' laravel: '^13.0' diff --git a/.gitignore b/.gitignore index a18cbb9..ec26905 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /.phpunit.cache /node_modules /build +/composer.lock diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6ecb903..3ce7f97 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,10 +59,13 @@ Common commands: ```bash composer test +composer run test-laravel-13-compat composer run validate-package composer run validate-package-publish ``` +`composer run test-laravel-13-compat` runs the Beacon suite against a temporary Laravel 13 / Testbench 11 dependency set so you can verify the current compatibility baseline locally without mutating your working tree. + If your change affects release or packaging behavior, also validate the relevant GitHub workflow inputs locally when practical. ## Scope guidance diff --git a/composer.json b/composer.json index 030d48e..b51cd54 100644 --- a/composer.json +++ b/composer.json @@ -55,6 +55,7 @@ "/.releaserc.json", "/build", "/docs/RELEASING.md", + "/scripts", "/node_modules", "/package-lock.json", "/package.json", @@ -78,6 +79,7 @@ }, "scripts": { "test": "vendor/bin/pest", + "test-laravel-13-compat": "bash scripts/test-laravel-13-compat.sh", "validate-package": "@composer validate --strict --no-check-publish", "validate-package-publish": "@composer validate --strict" }, diff --git a/scripts/test-laravel-13-compat.sh b/scripts/test-laravel-13-compat.sh new file mode 100755 index 0000000..592d552 --- /dev/null +++ b/scripts/test-laravel-13-compat.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +set -euo pipefail + +root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +temp_dir="$(mktemp -d "${TMPDIR:-/tmp}/beacon-laravel13-compat.XXXXXX")" + +cleanup() { + rm -rf "${temp_dir}" +} + +trap cleanup EXIT + +composer_cmd=() +herd_composer="${HOME}/Library/Application Support/Herd/bin/composer" +php_bin="" + +if command -v php84 >/dev/null 2>&1; then + php_bin="$(command -v php84)" +elif command -v php >/dev/null 2>&1; then + php_bin="$(command -v php)" +fi + +if [[ -n "${php_bin}" && -f "${herd_composer}" ]]; then + composer_cmd=("${php_bin}" "${herd_composer}") +elif command -v composer >/dev/null 2>&1; then + composer_cmd=("$(command -v composer)") +else + echo "Unable to find a usable Composer command for local Laravel 13 verification." >&2 + exit 1 +fi + +tar -C "${root_dir}" \ + --exclude='./.git' \ + --exclude='./vendor' \ + --exclude='./node_modules' \ + --exclude='./build' \ + --exclude='./.phpunit.cache' \ + -cf - . | tar -xf - -C "${temp_dir}" + +pushd "${temp_dir}" >/dev/null + +"${composer_cmd[@]}" update \ + --no-interaction \ + --no-progress \ + --prefer-dist \ + --with "illuminate/console:^13.0" \ + --with "illuminate/process:^13.0" \ + --with "illuminate/support:^13.0" \ + --with "orchestra/testbench:^11.0" + +"${composer_cmd[@]}" test + +popd >/dev/null From f26f17ed74d4a197e3be65937a20d91aa5812448 Mon Sep 17 00:00:00 2001 From: Derek Bourgeois Date: Sun, 5 Apr 2026 01:44:54 -0400 Subject: [PATCH 2/2] test: validate php version in laravel 13 helper --- scripts/test-laravel-13-compat.sh | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/scripts/test-laravel-13-compat.sh b/scripts/test-laravel-13-compat.sh index 592d552..54aab8f 100755 --- a/scripts/test-laravel-13-compat.sh +++ b/scripts/test-laravel-13-compat.sh @@ -15,18 +15,42 @@ composer_cmd=() herd_composer="${HOME}/Library/Application Support/Herd/bin/composer" php_bin="" -if command -v php84 >/dev/null 2>&1; then +require_supported_php() { + local candidate="$1" + local php_version="" + + if ! php_version="$("${candidate}" -r 'echo PHP_VERSION;' 2>/dev/null)"; then + echo "Unable to execute PHP binary '${candidate}' for local Laravel 13 verification." >&2 + exit 1 + fi + + if ! "${candidate}" -r 'exit(version_compare(PHP_VERSION, "8.3.0", ">=") ? 0 : 1);' >/dev/null 2>&1; then + echo "Laravel 13 compatibility tests require PHP 8.3 or newer. Found PHP ${php_version} at '${candidate}'." >&2 + exit 1 + fi +} + +if [[ -n "${PHP_BIN:-}" ]]; then + if ! php_bin="$(command -v "${PHP_BIN}")"; then + echo "Configured PHP_BIN '${PHP_BIN}' was not found. Set PHP_BIN to a PHP 8.3+ binary." >&2 + exit 1 + fi +elif command -v php84 >/dev/null 2>&1; then php_bin="$(command -v php84)" elif command -v php >/dev/null 2>&1; then php_bin="$(command -v php)" fi +if [[ -n "${php_bin}" ]]; then + require_supported_php "${php_bin}" +fi + if [[ -n "${php_bin}" && -f "${herd_composer}" ]]; then composer_cmd=("${php_bin}" "${herd_composer}") elif command -v composer >/dev/null 2>&1; then composer_cmd=("$(command -v composer)") else - echo "Unable to find a usable Composer command for local Laravel 13 verification." >&2 + echo "Unable to find a usable Composer command for local Laravel 13 verification. Ensure Composer is installed and PHP 8.3+ is available." >&2 exit 1 fi