Files
cacti/.github/workflows/pr-php-coverage.yml
dependabot[bot] 776b3ffcaf ci(deps): bump the github-actions group with 6 updates (#8553)
Bumps the github-actions group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.39.0` | `4.39.1` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.39.0` | `4.39.1` |
| [actions/setup-python](https://github.com/actions/setup-python) | `7.0.0` | `7.1.0` |
| [jdx/mise-action](https://github.com/jdx/mise-action) | `5.2.0` | `5.2.2` |
| [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog) | `3.99.2` | `3.99.7` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.39.0` | `4.39.1` |


Updates `github/codeql-action/init` from 4.39.0 to 4.39.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee...9b3254085494b55a0f7c4c2b3d2d52cc712ce370)

Updates `github/codeql-action/analyze` from 4.39.0 to 4.39.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee...9b3254085494b55a0f7c4c2b3d2d52cc712ce370)

Updates `actions/setup-python` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/5fda3b95a4ea91299a34e894583c3862153e4b97...6d4fd22b20465ccc0f7354476588e8df7c9ca0e0)

Updates `jdx/mise-action` from 5.2.0 to 5.2.2
- [Release notes](https://github.com/jdx/mise-action/releases)
- [Changelog](https://github.com/jdx/mise-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jdx/mise-action/compare/9b200bcecbfd6303e69a4a261b2e09e3757440a7...8418fedb1110381a0d3ba51a7a415d7c1b884550)

Updates `trufflesecurity/trufflehog` from 3.99.2 to 3.99.7
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Commits](https://github.com/trufflesecurity/trufflehog/compare/e76dff8a7e57d6df0c60ad8cbf5d5cba505a8fc9...31ce31ee1abbcc7dc8eee5764c17121c3044c8b2)

Updates `github/codeql-action/upload-sarif` from 4.39.0 to 4.39.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee...9b3254085494b55a0f7c4c2b3d2d52cc712ce370)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/setup-python
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: jdx/mise-action
  dependency-version: 5.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: trufflesecurity/trufflehog
  dependency-version: 3.99.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-31 21:56:26 +00:00

88 lines
3.4 KiB
YAML

name: Changed PHP Coverage
on:
pull_request:
paths:
- '**.php'
- 'tests/phpunit.xml'
- 'tests/e2e/**'
- 'tests/Helpers/RequestCoverage.php'
- 'tests/tools/check_changed_php_coverage.py'
- 'tests/tools/test_check_changed_php_coverage.py'
- 'tests/tools/run_request_coverage.sh'
- 'tests/tools/test_request_coverage_dispatch.py'
- '.github/workflows/pr-php-coverage.yml'
permissions:
contents: read
concurrency:
group: changed-php-coverage-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
coverage:
name: Changed PHP lines >= 80%
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
persist-credentials: false
- uses: jdx/mise-action@8418fedb1110381a0d3ba51a7a415d7c1b884550 # v5.2.2
with:
tool_versions: node 22.22.2
install_args: node
- uses: ./.github/actions/setup-php-composer
with:
php-version: '8.3'
coverage: xdebug
extensions: intl, mysql, gd, ldap, gmp, xml, curl, json, mbstring
ini-values: memory_limit=2G
dependency-mode: locked-pr-coverage
install-args: --prefer-dist --no-progress --no-interaction
- name: Validate the coverage gate and include every changed PHP file
env:
BASE_COMMIT: ${{ github.event.pull_request.base.sha }}
run: |
set -euo pipefail
python3 tests/tools/test_check_changed_php_coverage.py
python3 tests/tools/test_request_coverage_dispatch.py
python3 tests/tools/check_changed_php_coverage.py --base "$BASE_COMMIT" \
--prepare-config tests/phpunit.xml --output-config phpunit-changed.xml
- name: Exercise unit and integration contracts with statement coverage
env:
XDEBUG_MODE: coverage
run: include/vendor/bin/pest --configuration=phpunit-changed.xml --testsuite=Unit,Integration --coverage-clover=coverage-changed.xml
- name: Exercise applicable browser and database contracts
env:
BASE_COMMIT: ${{ github.event.pull_request.base.sha }}
CACTI_TEST_COVERAGE: '1'
CACTI_PR_RAW_COVERAGE: /tmp/cacti-pr-coverage
CACTI_PR_COVERAGE_OUTPUT: ${{ runner.temp }}/request-coverage
run: bash tests/tools/run_request_coverage.sh
- name: Require at least 80 percent of changed executable PHP lines
env:
BASE_COMMIT: ${{ github.event.pull_request.base.sha }}
run: |
set -euo pipefail
request_args=()
if compgen -G "${{ runner.temp }}/request-coverage/*.json" > /dev/null; then
request_args=(--request-reports "${{ runner.temp }}/request-coverage")
fi
python3 tests/tools/check_changed_php_coverage.py --base "$BASE_COMMIT" \
--report coverage-changed.xml "${request_args[@]}" \
--minimum 80 --json-output coverage-changed.json
- name: Preserve coverage evidence
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: changed-php-coverage
path: |
coverage-changed.xml
coverage-changed.json
${{ runner.temp }}/request-coverage
if-no-files-found: warn