Skip to content

Modernise TestContext and update docs for Symfony 7.4+ / Behat 3.31+ #479

Modernise TestContext and update docs for Symfony 7.4+ / Behat 3.31+

Modernise TestContext and update docs for Symfony 7.4+ / Behat 3.31+ #479

Workflow file for this run

name: Build
on:
push:
branches:
- master
pull_request:
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday
jobs:
test:
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version:
- '8.3'
- '8.4'
- '8.5'
symfony-version:
- '7.4.*'
- '8.0.*'
- '8.1.*'
exclude:
- php-version: '8.3'
symfony-version: '8.0.*'
- php-version: '8.3'
symfony-version: '8.1.*'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
ini-values: "memory_limit=-1, zend.assertions=1"
php-version: ${{ matrix.php-version }}
tools: composer:v2, flex
# This works around SYMFONY_REQUIRE currently not working (https://github.com/symfony/flex/issues/946):
- name: Lock Symfony version
run: VERSION=${{ matrix.symfony-version }} .github/workflows/lock-symfony-version.sh
- name: Require behat 4.x for Symfony 8+
if: startsWith(matrix.symfony-version, '8.')
run: |
cat <<< $(jq --indent 4 '."require-dev"."behat/behat" = "4.x-dev as 3.31.0"' < composer.json) > composer.json
composer config minimum-stability dev
composer config prefer-stable true
- name: Install dependencies
run: |
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer install --prefer-dist --no-progress --no-plugins
#env:
# SYMFONY_REQUIRE: "${{ matrix.symfony-version }}"
- name: Run tests
run: |
if [[ "${{ matrix.symfony-version }}" == 8.* ]]; then
vendor/bin/behat -f progress --strict -vvv --no-interaction --colors \
features/browserkit_integration features/configuration features/dependency_injection \
features/sanity_checks/accessing_a_context_in_another_context.feature \
features/sanity_checks/context_constructor_dependency_injection_compatibility.feature \
features/sanity_checks/isolating_contexts.feature \
features/sanity_checks/running_bare_behat_scenarios.feature
else
composer test
fi
psalm:
name: Run Psalm
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
ini-values: "memory_limit=-1, zend.assertions=1"
php-version: 8.3
tools: composer:v2, flex
- name: Install dependencies
run: |
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer install --prefer-dist --no-progress --no-plugins
- name: Run Psalm
run: vendor/bin/psalm src --no-progress
validate-composer:
name: Validate composer.json
runs-on: ubuntu-22.04
continue-on-error: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
ini-values: "memory_limit=-1, zend.assertions=1"
php-version: 8.3
tools: composer:v2, flex
- name: Validate composer.json
run: composer validate --strict
coding-standards:
name: Validate Coding Standards
runs-on: ubuntu-22.04
continue-on-error: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
ini-values: "memory_limit=-1, zend.assertions=1"
php-version: 8.3
tools: composer:v2, flex
- name: Install dependencies
run: |
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer install --prefer-dist --no-progress
- name: Run coding standard
run: vendor/bin/ecs check --ansi --no-progress-bar src tests