mirror of
https://github.com/Cacti/cacti.git
synced 2026-10-28 07:37:11 +09:00
* ci: share one body across the per-script coverage workflows Eight of the coverage workflows were the same file with four things changed: the PHPUnit configuration, the job name, occasionally the PHP version, and occasionally the snmp extension. Everything else, the triggers, permissions, concurrency, checkout, dependency setup and the Pest invocation, was copied between them, so a change to any of it meant eight edits and eight chances to miss one. They now call a reusable workflow and supply only what differs. Each caller keeps its own path filters and concurrency group, since those are genuinely per-script. installer, snmp and rrd-graph-item are left alone. They run more than one suite or produce clover output, so folding them in would mean parameterising the shared body until it stopped being shared. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: rebuild the callers when the shared coverage body changes Each caller watched its own file but not the reusable one, so editing the shared body would not have run any of the suites it drives. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: Entity Sensor Coverage
|
|
|
|
on:
|
|
push:
|
|
branches: [develop]
|
|
paths:
|
|
- '.github/workflows/script-coverage.yml'
|
|
- '.github/workflows/entity-sensor-coverage.yml'
|
|
- '.github/actions/setup-php-composer/**'
|
|
- 'composer.json'
|
|
- 'composer.lock'
|
|
- 'scripts/ss_entity_sensor.php'
|
|
- 'phpunit-entity-sensor.xml'
|
|
- 'tests/Unit/DataCollection/Scripts/EntitySensorTest.php'
|
|
pull_request:
|
|
branches: [develop]
|
|
paths:
|
|
- '.github/workflows/script-coverage.yml'
|
|
- '.github/workflows/entity-sensor-coverage.yml'
|
|
- '.github/actions/setup-php-composer/**'
|
|
- 'composer.json'
|
|
- 'composer.lock'
|
|
- 'scripts/ss_entity_sensor.php'
|
|
- 'phpunit-entity-sensor.xml'
|
|
- 'tests/Unit/DataCollection/Scripts/EntitySensorTest.php'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: entity-sensor-coverage-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
coverage:
|
|
uses: ./.github/workflows/script-coverage.yml
|
|
with:
|
|
job-name: scripts/ss_entity_sensor.php 100% coverage
|
|
phpunit-config: phpunit-entity-sensor.xml
|
|
extensions: intl, mysql, gd, ldap, gmp, xml, curl, json, mbstring, snmp
|