Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 59 additions & 62 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,82 @@
name: Build

on:
push: ~
pull_request: ~
push:
branches:
- master
pull_request:
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday

jobs:
tests:
test:
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}
runs-on: ubuntu-latest
name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, Behat ${{ matrix.behat }}, ${{ matrix.dependencies }} deps"
strategy:
fail-fast: false
matrix:
php: ["8.1", "8.2", "8.3"]
symfony: ["^5.4", "^6.4", "^7.0"]
behat: ["^3.10"]
dependencies: ["lowest", "highest"]
php-version:
- '8.3'
- '8.4'
- '8.5'
symfony-version:
- '7.4.*'
- '8.0.*'
- '8.1.*'
exclude:
- symfony: "^7.0"
php: "8.1"
include:
- php: "8.1"
symfony: "^5.4"
behat: ">=3.0 <3.10"
dependencies: "lowest"
- php: "8.2"
symfony: "^6.4"
behat: ">=3.0 <3.10"
dependencies: "lowest"
- php: "8.3"
symfony: "^7.0"
behat: "4.x-dev"
dependencies: "highest"
- php: "8.4"
symfony: "^8.0"
behat: "4.x-dev"
dependencies: "highest"

- php-version: '8.3'
symfony-version: '8.0.*'
- php-version: '8.3'
symfony-version: '8.1.*'
steps:
-
uses: actions/checkout@v6
- 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

- name: Lock Symfony version
run: composer require --no-update --no-interaction \
"symfony/filesystem:~${{ matrix.symfony-version }}" \
"symfony/process:~${{ matrix.symfony-version }}"

-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
- name: Require behat 4.x for Symfony 8+
if: startsWith(matrix.symfony-version, '8.')
run: |
cat <<< $(jq --indent 4 '.require."behat/behat" = "4.x-dev as 3.31.0"' < composer.json) > composer.json
composer config minimum-stability dev
composer config prefer-stable true

-
name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global require --no-progress --no-scripts --no-plugins "symfony/flex"
composer global config --no-plugins allow-plugins.symfony/flex true
composer config extra.symfony.require "${{ matrix.symfony }}"
composer config minimum-stability "dev"
composer config prefer-stable true
- name: Install dependencies
run: composer install --prefer-dist --no-progress

-
name: Restrict Behat version
run: composer require --no-update "behat/behat:${{ matrix.behat }}"
- name: Run PHPStan
run: vendor/bin/phpstan analyse --no-progress

-
name: Install dependencies
run: composer update ${{ matrix.dependencies == 'lowest' && '--prefer-lowest --prefer-stable' || '' }}
- name: Run tests
run: vendor/bin/behat -f progress --strict -vvv --no-interaction --colors

-
name: Composer validate
if: matrix.behat != '4.x-dev'
run: composer validate --strict --ansi
validate-composer:
name: Validate composer.json
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

-
name: Run PHPStan
if: matrix.behat != '>=3.0 <3.10'
run: vendor/bin/phpstan analyse --no-progress
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.3'
tools: composer:v2

-
name: Run tests
run: vendor/bin/behat ${{ matrix.behat != '4.x-dev' && '--config behat.yml.dist' || '' }} -f progress --strict -vvv --no-interaction --colors
- name: Validate composer.json
run: composer validate --strict
2 changes: 1 addition & 1 deletion behat.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(new Profile('default'))
->withSuite(
(new Suite('default'))
->withPaths(__DIR__ . '/features/attributes')
->withPaths(__DIR__ . '/features')
->withContexts(TestContext::class)
)
);
7 changes: 0 additions & 7 deletions behat.yml.dist

This file was deleted.

14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
}
],
"require": {
"php": "^8.1",
"behat/behat": "^3.0 || ^4.0",
"symfony/filesystem": "^5.4 || ^6.4 || ^7.0 || ^8.0",
"symfony/process": "^5.4 || ^6.4 || ^7.0 || ^8.0"
"php": "^8.3",
"behat/behat": "^3.31",
"symfony/filesystem": "^7.4",
"symfony/process": "^7.4"
},
"require-dev": {
"phpstan/phpstan": "^2.1"
},
"autoload": {
"files": [
"src/autoload.php"
]
"psr-4": {
"FriendsOfBehat\\TestContext\\": "src/"
}
}
}
108 changes: 0 additions & 108 deletions features/annotations/basic_steps_for_testing.feature

This file was deleted.

39 changes: 0 additions & 39 deletions features/annotations/independent_scenarios.feature

This file was deleted.

40 changes: 0 additions & 40 deletions features/attributes/simple_scenarios.feature

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ Feature: Basic steps for testing
Scenario: Failing Behat due to its configuration
Given a Behat configuration containing:
"""
default:
extensions:
Unknown\Extension: ~
<?php
return new \Behat\Config\Config([
'default' => ['extensions' => ['Unknown\Extension' => null]],
]);
"""
When I run Behat
Then it should fail with "Behat\Testwork\ServiceContainer\Exception\ExtensionInitializationException"
6 changes: 6 additions & 0 deletions phpstan-bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

declare(strict_types=1);

// BEHAT_BIN_PATH is defined at runtime by behat's bootstrap process
define('BEHAT_BIN_PATH', '');
Loading