Skip to content

updated to phpunit 10 #503

updated to phpunit 10

updated to phpunit 10 #503

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- master
jobs:
static_analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:
PATTERNS: |
pkg/**/*.php
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M
- run: php ./bin/fix-symfony-version.php "5.4.*"
- uses: "ramsey/composer-install@v1"
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
- run: cd docker && docker build --rm --force-rm --no-cache --pull --tag "enqueue/dev:latest" -f Dockerfile .
- run: docker run --workdir="/mqdev" -v "`pwd`:/mqdev" --rm enqueue/dev:latest php -d memory_limit=1024M bin/phpstan analyse -l 1 -c phpstan.neon --error-format=github -- ${{ env.GIT_DIFF_FILTERED }}
if: env.GIT_DIFF_FILTERED
code_style_check:
name: Code style check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:
PATTERNS: |
pkg/**/*.php
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-cs-check-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-cs-check-
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M
- run: php ./bin/fix-symfony-version.php "5.4.*"
- run: composer update --no-progress
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
- run: ./bin/php-cs-fixer fix --config=.php_cs.php --no-interaction --dry-run --diff -v --path-mode=intersection -- ${{ env.GIT_DIFF_FILTERED }}
if: env.GIT_DIFF_FILTERED
unit_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
symfony_version: ['5.4.*', '6.2.*', '6.3.*']
dependencies: ['--prefer-lowest', '--prefer-dist']
exclude:
- php: '7.4'
symfony_version: '6.2.*'
- php: '7.4'
symfony_version: '6.3.*'
- php: '8.0'
symfony_version: '6.2.*'
- php: '8.0'
symfony_version: '6.3.*'
name: PHP ${{ matrix.php }} unit tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }}
steps:
- uses: actions/checkout@v2
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M
- run: php ./bin/fix-symfony-version.php "${{ matrix.symfony_version }}"
- run: composer update --no-progress ${{ matrix.dependencies }}
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
- run: bin/phpunit --exclude-group=functional
functional_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2'] # same as in the container
symfony_version: ['5.4.*', '6.2.*', '6.3.*']
dependencies: ['--prefer-lowest', '--prefer-dist']
exclude:
- php: '7.4'
symfony_version: '6.2.*'
- php: '7.4'
symfony_version: '6.3.*'
- php: '8.0'
symfony_version: '6.2.*'
- php: '8.0'
symfony_version: '6.3.*'
name: PHP ${{ matrix.php }} functional tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }}
steps:
- uses: actions/checkout@v2
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M
- run: php ./bin/fix-symfony-version.php "${{ matrix.symfony_version }}"
- run: composer update --no-progress ${{ matrix.dependencies }}
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
- run: bin/dev -b
env:
PHP_VERSION: ${{ matrix.php }}
# TODO: convert these two steps into one w/o excludes when Gearman extension gets a release for PHP 8.1
# See https://github.com/php/pecl-networking-gearman/issues/16
- run: bin/test.sh
if: ${{ matrix.php != '8.1' && matrix.php != '8.2' }}
- run: bin/test.sh --exclude-group=gearman
if: ${{ matrix.php == '8.1' && matrix.php != '8.2' }}