From e46e52ef806badaca4ab589a59c21b9505b060e9 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Fri, 3 Apr 2026 13:42:10 +0100 Subject: [PATCH 1/5] [feature/add-test-matrix] Add pull request test workflow --- .github/workflows/tests.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d31bb82 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,39 @@ +name: Tests + +on: + pull_request: + +jobs: + tests: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php: ['8.1', '8.2', '8.3', '8.4'] + + name: PHP ${{ matrix.php }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php }}-composer- + + - name: Install Composer dependencies + run: composer install --prefer-dist --no-interaction --no-progress + + - name: Run tests + run: ./vendor/bin/pest --parallel --processes=24 From ce74cfdfef939db07fcf8a813f8a633e9d299066 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Fri, 3 Apr 2026 13:47:26 +0100 Subject: [PATCH 2/5] [feature/add-test-matrix] Adjust test matrix for Composer compatibility --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d31bb82..bedb2dd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2', '8.3', '8.4'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} @@ -24,16 +24,16 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - name: Cache Composer dependencies + - name: Cache Composer downloads uses: actions/cache@v4 with: - path: vendor + path: ~/.composer/cache/files key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.lock') }} restore-keys: | ${{ runner.os }}-php-${{ matrix.php }}-composer- - - name: Install Composer dependencies - run: composer install --prefer-dist --no-interaction --no-progress + - name: Resolve Composer dependencies + run: composer update --prefer-dist --no-interaction --no-progress - name: Run tests run: ./vendor/bin/pest --parallel --processes=24 From 62a5e35437c4dcf83ce1b29f30c381988f5a0009 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Fri, 3 Apr 2026 13:52:26 +0100 Subject: [PATCH 3/5] [feature/add-test-matrix] Add PHP 8.1 smoke workflow check --- .github/workflows/tests.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bedb2dd..fe76ec6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,3 +37,37 @@ jobs: - name: Run tests run: ./vendor/bin/pest --parallel --processes=24 + + php81-smoke: + runs-on: ubuntu-latest + + name: PHP 8.1 smoke + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + coverage: none + + - name: Cache Composer downloads + uses: actions/cache@v4 + with: + path: ~/.composer/cache/files + key: ${{ runner.os }}-php-8.1-composer-${{ hashFiles('composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-8.1-composer- + + - name: Install runtime dependencies + run: composer install --no-dev --prefer-dist --no-interaction --no-progress + + - name: Lint package source + run: | + php -l helper.php + find src config -name '*.php' -print0 | xargs -0 -n 1 php -l + + - name: Bootstrap package autoload + run: php -r "require 'vendor/autoload.php'; exit(class_exists('Midnite81\\\\Core\\\\CoreServiceProvider') ? 0 : 1);" From 7af2e8faafa21e64fec7515399865525a657f7e9 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Fri, 3 Apr 2026 13:54:17 +0100 Subject: [PATCH 4/5] [feature/add-test-matrix] Fix workflow YAML quoting --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fe76ec6..482f3cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,4 +70,5 @@ jobs: find src config -name '*.php' -print0 | xargs -0 -n 1 php -l - name: Bootstrap package autoload - run: php -r "require 'vendor/autoload.php'; exit(class_exists('Midnite81\\\\Core\\\\CoreServiceProvider') ? 0 : 1);" + run: | + php -r 'require "vendor/autoload.php"; exit(class_exists("Midnite81\\Core\\CoreServiceProvider") ? 0 : 1);' From 7e0cae2d27d25d7ee3daf8113e3bc8855224c0db Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Fri, 3 Apr 2026 13:55:38 +0100 Subject: [PATCH 5/5] [feature/add-test-matrix] Fix PHP 8.1 smoke autoload check --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 482f3cd..ab3ec24 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,4 +71,4 @@ jobs: - name: Bootstrap package autoload run: | - php -r 'require "vendor/autoload.php"; exit(class_exists("Midnite81\\Core\\CoreServiceProvider") ? 0 : 1);' + php -r 'require "vendor/autoload.php"; exit((function_exists("first_value") && enum_exists("Midnite81\\Core\\Enums\\DateFormat")) ? 0 : 1);'