Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/php-stan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
permissions:
contents: read

# Deliberately single-version, unlike the test matrix: PHPStan and php-cs-fixer judge the
# source, not the runtime, so running them on four PHP versions repeats the same verdict.
# The version pinned here is the project minimum, which is also the one php-cs-fixer wants
# to run on (it warns when the runtime is newer than composer.json allows for).
jobs:
build:
runs-on: ubuntu-latest
Expand Down
48 changes: 41 additions & 7 deletions .github/workflows/php-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,40 @@ on:
permissions:
contents: read

# composer.json allows PHP ^8.2 and tuupola/base62 ^2.1, so that whole range is what
# consumers may resolve to. Three dependency variants cover it:
# locked — what composer.lock pins (the combination developers actually run)
# highest — newest allowed, catches upstream releases that break us
# lowest — the bottom of every constraint, the only job proving `^` lower bounds
# are real. Runs on the minimum PHP only; older dev tooling on the newest
# PHP tests the tooling, not this library.
jobs:
build:
test:
name: "PHP ${{ matrix.php-version }} / ${{ matrix.dependencies }}"
runs-on: ubuntu-latest
timeout-minutes: 3
timeout-minutes: 5
concurrency:
group: test-${{ github.event_name }}-${{ github.ref_name }}
group: test-${{ github.event_name }}-${{ github.ref_name }}-${{ matrix.php-version }}-${{ matrix.dependencies }}
cancel-in-progress: true

strategy:
# One broken combination should not hide the state of the others.
fail-fast: false
matrix:
php-version: [ '8.2', '8.3', '8.4', '8.5' ]
dependencies: [ locked, highest ]
include:
- php-version: '8.2'
dependencies: lowest

steps:
- uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: ${{ matrix.php-version }}
coverage: none

- name: Validate composer.json and composer.lock
run: composer validate --strict
Expand All @@ -33,12 +52,27 @@ jobs:
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-

- name: Install dependencies
run: composer install --prefer-dist --no-progress
run: |
case "${{ matrix.dependencies }}" in
locked)
composer install --prefer-dist --no-progress
;;
highest)
composer update --prefer-dist --no-progress
;;
lowest)
composer update --prefer-dist --no-progress --prefer-lowest --prefer-stable
;;
*)
echo "Unknown dependencies variant: ${{ matrix.dependencies }}" >&2
exit 1
;;
esac

- name: Run test suite
run: composer run-script test