Skip to content

Revert "update job name" #920

Revert "update job name"

Revert "update job name" #920

Workflow file for this run

name: CI
on:
- pull_request
- push
permissions:
contents: read # to fetch code (actions/checkout)
concurrency:
group: ci-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true
env:
PHP_MAX: '8.2'
PHP_MIN: '7.4'
jobs:
tests:
strategy:
fail-fast: false
matrix:
include:
- operating-system: 'ubuntu-20.04'
php-version: '7.4'
job-description: 'Fixer with lowest deps'
run-fixer: 'yes'
composer-flags: '--prefer-lowest' # should be checked on the lowest supported PHP version
execute-flex-with-symfony-version: '^5' # explicit check for Symfony 5.x compatibility
- operating-system: 'ubuntu-20.04'
php-version: '7.4'
job-description: 'tests with lowest deps'
run-tests: 'yes'
composer-flags: '--prefer-lowest' # should be checked on the lowest supported PHP version
execute-flex-with-symfony-version: '^5' # explicit check for Symfony 5.x compatibility
- operating-system: 'ubuntu-20.04'
php-version: '8.0'
job-description: 'Fixer'
run-fixer: 'yes'
- operating-system: 'ubuntu-20.04'
php-version: '8.0'
job-description: 'tests'
run-tests: 'yes'
- operating-system: 'ubuntu-20.04'
php-version: '8.1'
job-description: 'Fixer with Symfony ^6'
run-fixer: 'yes'
execute-flex-with-symfony-version: '^6' # explicit check for Symfony 6.x compatibility
- operating-system: 'ubuntu-20.04'
php-version: '8.1'
job-description: 'tests with Symfony ^6'
run-tests: 'yes'
execute-flex-with-symfony-version: '^6' # explicit check for Symfony 6.x compatibility
- operating-system: 'ubuntu-20.04'
php-version: '8.2'
job-description: 'Fixer'
run-fixer: 'yes'
- operating-system: 'ubuntu-20.04'
php-version: '8.2'
job-description: 'Fixer with migration rules'
run-fixer: 'yes'
run-migration-rules: 'yes' # should be checked on the highest supported PHP version
- operating-system: 'ubuntu-20.04'
php-version: '8.2'
job-description: 'tests'
run-tests: 'yes'
- operating-system: 'ubuntu-20.04'
php-version: '8.2'
job-description: 'tests with migration rules'
run-tests: 'yes'
run-migration-rules: 'yes' # should be checked on the highest supported PHP version
- operating-system: 'ubuntu-20.04'
php-version: '8.2'
job-description: 'code coverage'
collect-code-coverage: 'yes'
- operating-system: 'windows-latest'
php-version: '8.2'
job-description: 'Fixer on Windows'
run-fixer: 'yes'
FAST_LINT_TEST_CASES: 1 # we need full syntax check on one job at least, no need to do it on additional
- operating-system: 'windows-latest'
php-version: '8.2'
job-description: 'tests on Windows'
run-tests: 'yes'
FAST_LINT_TEST_CASES: 1 # we need full syntax check on one job at least, no need to do it on additional systems
- operating-system: 'macos-latest'
php-version: '8.2'
job-description: 'Fixer on macOS'
run-fixer: 'yes'
FAST_LINT_TEST_CASES: 1 # we need full syntax check on one job at least, no need to do it on additional systems
- operating-system: 'macos-latest'
php-version: '8.2'
job-description: 'tests on macOS'
run-tests: 'yes'
FAST_LINT_TEST_CASES: 1 # we need full syntax check on one job at least, no need to do it on additional
- operating-system: 'ubuntu-22.04'
php-version: '8.3'
job-description: 'Fixer'
run-fixer: 'yes'
composer-flags: '--ignore-platform-req=PHP'
PHP_CS_FIXER_IGNORE_ENV: 1
- operating-system: 'ubuntu-22.04'
php-version: '8.3'
job-description: 'tests'
run-tests: 'yes'
composer-flags: '--ignore-platform-req=PHP'
PHP_CS_FIXER_IGNORE_ENV: 1
name: PHP ${{ matrix.php-version }} ${{ matrix.job-description }}
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Resolve PHP coverage flag
uses: actions/github-script@v6
id: setup-php-resolve-coverage
with:
script: 'return "${{ matrix.code-coverage }}" == "yes" ? "pcov" : "none"'
result-encoding: string
- name: Resolve PHP tools flag
uses: actions/github-script@v6
id: setup-php-resolve-tools
with:
script: 'return "${{ matrix.execute-flex-with-symfony-version }}" ? "flex" : "none"'
result-encoding: string
- name: Setup PHP
uses: ./.github/composite-actions/setup-php
with:
version: ${{ matrix.php-version }}
coverage: ${{ steps.setup-php-resolve-coverage.outputs.result }}
tools: ${{ steps.setup-php-resolve-tools.outputs.result }}
- name: Setup cache
uses: ./.github/composite-actions/setup-cache
with:
php: ${{ matrix.php-version }}
os: ${{ runner.os }}
- name: Configure Symfony Flex
if: matrix.execute-flex-with-symfony-version
run: composer config extra.symfony.require ${{ matrix.execute-flex-with-symfony-version }}
- name: Install Composer deps
uses: ./.github/composite-actions/install-composer-deps
with:
flags: ${{ matrix.composer-flags }}
# Execute migration rules before running tests and self-fixing,
# so we know that our codebase is future-ready.
# Should be checked on the highest supported PHP version.
- name: Run PHP CS Fixer with migration rules
if: env.PHP_MAX == matrix.php-version && matrix.run-migration-rules == 'yes'
env:
PHP_CS_FIXER_FUTURE_MODE: 1
run: php php-cs-fixer fix --config .php-cs-fixer.php-highest.php -q
- name: Disable time limit for tests when collecting coverage
if: matrix.collect-code-coverage == 'yes'
run: sed 's/enforceTimeLimit="true"/enforceTimeLimit="false"/g' phpunit.xml.dist > phpunit.xml
- name: Run tests
if: matrix.run-tests == 'yes' && matrix.collect-code-coverage != 'yes'
env:
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }}
FAST_LINT_TEST_CASES: ${{ matrix.FAST_LINT_TEST_CASES }}
run: vendor/bin/paraunit run --exclude-group auto-review
- name: Collect code coverage
if: matrix.collect-code-coverage == 'yes'
env:
FAST_LINT_TEST_CASES: 1
run: vendor/bin/paraunit coverage --testsuite coverage --exclude-group covers-nothing --clover build/logs/clover.xml
- name: Upload coverage results to Coveralls
if: matrix.collect-code-coverage == 'yes'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php vendor/bin/php-coveralls --verbose
- name: Run PHP CS Fixer
if: matrix.run-fixer == 'yes'
env:
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }}
PHP_CS_FIXER_FUTURE_MODE: 1
run: php php-cs-fixer check --diff -v
# Should be checked on the lowest supported PHP version.
# If any type can be converted from PHPDoc to native type on lowest supported PHP, we should commit such change.
- name: Run PHP CS Fixer with PHPDoc to type rules
if: matrix.run-fixer == 'yes' && env.PHP_MIN == matrix.php-version
env:
PHP_CS_FIXER_FUTURE_MODE: 1
run: php php-cs-fixer check --diff -v --config .php-cs-fixer.php-lowest.php
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/