diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6953bf46289..c4dc6c9d9fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,11 +87,6 @@ jobs: job-description: 'code coverage' collect-code-coverage: 'yes' - - operating-system: 'ubuntu-20.04' - php-version: '8.2' - job-description: 'deployment check' - execute-deployment: 'yes' - - operating-system: 'windows-latest' php-version: '8.2' job-description: 'Fixer on Windows' @@ -214,8 +209,41 @@ jobs: PHP_CS_FIXER_FUTURE_MODE: 1 run: php php-cs-fixer check --diff -v - - name: Execute deployment checks - if: matrix.execute-deployment == 'yes' - run: | - ./dev-tools/build.sh - PHP_CS_FIXER_TEST_ALLOW_SKIPPING_SMOKE_TESTS=0 vendor/bin/phpunit tests/Smoke/ + deployment: + needs: tests + strategy: + fail-fast: false + matrix: + include: + - operating-system: 'ubuntu-20.04' + php-version: '8.2' + + name: Deployment checks + + runs-on: ${{ matrix.operating-system }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: ./.github/composite-actions/setup-php + with: + version: ${{ matrix.php-version }} + + - name: Setup cache + uses: ./.github/composite-actions/setup-cache + with: + php: ${{ matrix.php-version }} + os: ${{ runner.os }} + + - name: Install Composer deps + uses: ./.github/composite-actions/install-composer-deps + + - name: Build phar + run: ./dev-tools/build.sh + + - name: Run smoke tests + env: + PHP_CS_FIXER_TEST_ALLOW_SKIPPING_SMOKE_TESTS: 0 + run: vendor/bin/phpunit tests/Smoke/ diff --git a/tests/AutoReview/CiConfigurationTest.php b/tests/AutoReview/CiConfigurationTest.php index edca8e1c77b..ba92a901101 100644 --- a/tests/AutoReview/CiConfigurationTest.php +++ b/tests/AutoReview/CiConfigurationTest.php @@ -154,9 +154,7 @@ private static function assertSupportedPhpVersionsAreCoveredByCiJobs(array $supp */ private function getAllPhpVersionsUsedByCiForDeployments(): array { - $jobs = array_filter($this->getGitHubJobs(), static fn (array $job): bool => isset($job['execute-deployment']) && 'yes' === $job['execute-deployment']); - - return array_map(static fn ($job): string => \is_string($job['php-version']) ? $job['php-version'] : sprintf('%.1f', $job['php-version']), $jobs); + return array_map(static fn ($job): string => \is_string($job['php-version']) ? $job['php-version'] : sprintf('%.1f', $job['php-version']), $this->getGitHubDeploymentJobs()); } /** @@ -216,11 +214,11 @@ private function getMinPhpVersionFromEntryFile(): string /** * @return list> */ - private function getGitHubJobs(): array + private function getGitHubDeploymentJobs(): array { $yaml = Yaml::parse(file_get_contents(__DIR__.'/../../.github/workflows/ci.yml')); - return $yaml['jobs']['tests']['strategy']['matrix']['include']; + return $yaml['jobs']['deployment']['strategy']['matrix']['include']; } /**