Skip to content

feat: Bump min PHP version supported to PHP 8.3 #267

feat: Bump min PHP version supported to PHP 8.3

feat: Bump min PHP version supported to PHP 8.3 #267

Workflow file for this run

name: "Tests"
on:
push:
branches:
- "main"
pull_request: null
schedule:
# Do not make it the first of the month and/or midnight since it is a very busy time
- cron: "* 10 5 * *"
jobs:
tests:
runs-on: "ubuntu-latest"
name: "Tests with PHP ${{ matrix.php }}${{ matrix.debug && ' and the make `--debug` flag' || '' }}"
strategy:
fail-fast: true
matrix:
php:
- "8.3"
- "8.4"
debug: [false]
include:
- php: "8.3"
debug: true
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
tools: "composer"
- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"
- name: "Run tests"
if: ${{ !matrix.debug }}
run: "make phpunit"
- name: "Run tests with debug"
if: ${{ matrix.debug }}
run: "make phpunit --debug"
infection:
runs-on: "ubuntu-latest"
name: "Infection with PHP ${{ matrix.php }}"
strategy:
fail-fast: true
matrix:
php:
- "8.4"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
tools: "composer"
coverage: "xdebug"
- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"
- name: "Run tests and mutation testing"
run: "make infection"
# This is a "trick", a meta task which does not change, and we can use in
# the protected branch rules as opposed to the individual tests which
# may change regularly.
validate-tests:
name: Tests Status
runs-on: ubuntu-latest
needs:
- tests
- infection
if: always()
steps:
- name: Successful run
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1