# yamllint disable rule:line-length name: Continuous Integration on: - pull_request - push jobs: tests: strategy: matrix: operating-system: - ubuntu-latest php-version: - '7.0' - '7.1' - '7.2' - '7.3' - '7.4' include: - operating-system: 'ubuntu-latest' php-version: '8.0' composer-flags: '--ignore-platform-req=php' PHP_CS_FIXER_IGNORE_ENV: 1 - operating-system: 'ubuntu-latest' php-version: '5.6' PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER: 1 SYMFONY_DEPRECATIONS_HELPER: disabled - operating-system: 'windows-latest' php-version: '7.3' FAST_LINT_TEST_CASES: 1 - operating-system: 'windows-latest' php-version: '5.6' SKIP_LINT_TEST_CASES: 1 - operating-system: 'macos-latest' php-version: '7.4' PHP_CS_FIXER_FUTURE_MODE: 1 name: PHP ${{ matrix.php-version }} CI on ${{ matrix.operating-system }} ${{ matrix.composer-flags }} runs-on: ${{ matrix.operating-system }} steps: - name: Checkout code uses: actions/checkout@v2 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - name: Get Composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-dir)" - name: Cache dependencies uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }} restore-keys: | composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}- composer-${{ runner.os }}-${{ matrix.php-version }}- composer-${{ runner.os }}- composer- - name: Install dependencies uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 retry_wait_seconds: 30 command: | composer update --optimize-autoloader --no-interaction --no-progress ${{ matrix.composer-flags }} - name: Run tests continue-on-error: ${{ matrix.php-version == '8.0' }} env: PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }} FAST_LINT_TEST_CASES: ${{ matrix.FAST_LINT_TEST_CASES }} SKIP_LINT_TEST_CASES: ${{ matrix.SKIP_LINT_TEST_CASES }} PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER: ${{ matrix.PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER }} SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.SYMFONY_DEPRECATIONS_HELPER }} run: | vendor/bin/phpunit - name: Run PHP CS Fixer env: PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }} PHP_CS_FIXER_FUTURE_MODE: ${{ matrix.PHP_CS_FIXER_FUTURE_MODE }} run: | php php-cs-fixer --diff --dry-run -v fix