name: Installer coverage on: push: branches: [develop] paths: - '.github/workflows/installer-coverage.yml' - '.github/actions/setup-php-composer/**' - '.github/actions/setup-ci-docker/**' - 'composer.json' - 'composer.lock' - 'cacti.sql' - 'cli/convert_tables.php' - 'cli/install_cacti.php' - 'cli/upgrade_database.php' - 'docker/**' - 'install/**' - 'lib/import.php' - 'lib/installer.php' - 'lib/utility.php' - 'tests/phpunit-installer.xml' - 'tests/Unit/Installer/**' - 'tests/Unit/Security/Csrf/InstallerCsrfRecoveryTest.php' - 'tests/e2e/installer_resilience_docker.sh' - 'tests/e2e/installer_failure_paths.php' - 'tests/fixtures/InstallerCliProbe.php' - 'tests/integration/Installer*.php' pull_request: branches: [develop] paths: - '.github/workflows/installer-coverage.yml' - '.github/actions/setup-php-composer/**' - '.github/actions/setup-ci-docker/**' - 'composer.json' - 'composer.lock' - 'cacti.sql' - 'cli/convert_tables.php' - 'cli/install_cacti.php' - 'cli/upgrade_database.php' - 'docker/**' - 'install/**' - 'lib/import.php' - 'lib/installer.php' - 'lib/utility.php' - 'tests/phpunit-installer.xml' - 'tests/Unit/Installer/**' - 'tests/Unit/Security/Csrf/InstallerCsrfRecoveryTest.php' - 'tests/e2e/installer_resilience_docker.sh' - 'tests/e2e/installer_failure_paths.php' - 'tests/fixtures/InstallerCliProbe.php' - 'tests/integration/Installer*.php' workflow_dispatch: permissions: contents: read concurrency: group: installer-coverage-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: unit: name: installer unit and contract tests runs-on: ubuntu-24.04 timeout-minutes: 20 steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: fetch-depth: 0 persist-credentials: false - name: Set up PHP and Cacti test dependencies uses: ./.github/actions/setup-php-composer with: php-version: '8.3' coverage: xdebug extensions: intl, mysql, gd, ldap, gmp, xml, curl, json, mbstring dependency-mode: locked-tests install-args: --prefer-dist --no-progress --no-interaction - name: Run installer unit tests env: XDEBUG_MODE: coverage run: | set -euo pipefail composer test -- --colors=never \ --configuration=tests/phpunit-installer.xml \ --testsuite='Installer Unit' \ --fail-on-empty-test-suite \ --fail-on-warning \ --coverage \ --coverage-text \ --coverage-clover installer-unit-coverage.xml \ --min=2 - name: Run installer integration contracts run: | set -euo pipefail composer test -- --colors=never \ --configuration=tests/phpunit-installer.xml \ --testsuite='Installer Integration' \ --fail-on-empty-test-suite \ --fail-on-warning - name: Upload unit coverage if: always() uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 with: name: installer-unit-coverage path: installer-unit-coverage.xml if-no-files-found: error docker-integration: name: installer Docker integration matrix runs-on: ubuntu-24.04 timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: fetch-depth: 0 persist-credentials: false - name: Set up Docker with the public registry cache uses: ./.github/actions/setup-ci-docker - name: Run fresh, upgrade, CLI, and background scenarios run: tests/e2e/installer_resilience_docker.sh