Files
cacti/.github/workflows/script-coverage.yml
Thomas Vincent 79a9ae0351 build: raise the 1.3 floor to PHP 8.3 (#7939)
* build: raise the 1.3 floor to PHP 8.3

RHEL 10 ships 8.3 in AppStream and dropped modularity, so an 8.4 floor would
put every RHEL, Alma and Rocky 10 install on Remi. Ubuntu 24.04 is 8.3 as
well, which makes it the lowest common denominator of the current LTS fleet.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: raise the documented PHP floor to 8.3

The 1.2.x column keeps 8.1, which still matches that branch's composer constraint.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* ci: run process lock coverage on PHP 8.3

* fix: finish PHP 8.3 floor cleanup

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
2026-09-06 08:44:40 -07:00

73 lines
2.1 KiB
YAML

name: Script Coverage
# Reusable body for the per-script coverage workflows. Each caller supplies the
# PHPUnit configuration and the job name; everything else was identical across
# them and is kept here so it can only drift in one place.
on:
workflow_call:
inputs:
job-name:
description: Name shown for the job, usually the script and its target.
required: true
type: string
phpunit-config:
description: PHPUnit configuration file for this script.
required: true
type: string
php-version:
description: PHP version to run the suite against.
required: false
type: string
default: '8.3'
extensions:
description: PHP extensions the suite needs.
required: false
type: string
default: 'intl, mysql, gd, ldap, gmp, xml, curl, json, mbstring'
min-coverage:
description: Minimum line coverage percentage.
required: false
type: number
default: 100
permissions:
contents: read
env:
COMPOSER_ALLOW_SUPERUSER: 1
jobs:
coverage:
name: ${{ inputs.job-name }}
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Setup locked PHP ${{ inputs.php-version }} dependencies
uses: ./.github/actions/setup-php-composer
with:
php-version: ${{ inputs.php-version }}
coverage: xdebug
extensions: ${{ inputs.extensions }}
dependency-mode: locked
install-args: --prefer-dist --no-progress --no-interaction
- name: Enforce line coverage
env:
XDEBUG_MODE: coverage
PHPUNIT_CONFIG: ${{ inputs.phpunit-config }}
MIN_COVERAGE: ${{ inputs.min-coverage }}
run: |
set -euo pipefail
include/vendor/bin/pest --colors=never \
--configuration="$PHPUNIT_CONFIG" \
--coverage \
--coverage-text \
--min="$MIN_COVERAGE"