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
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# See https://symfony.com/releases & https://www.php.net/supported-versions.php
- php-version: '8.2'
symfony-version: '^7.0'
- php-version: '8.3'
symfony-version: '^7.0'
- php-version: '8.4'
symfony-version: '^7.0'
- php-version: '8.4'
symfony-version: '^8.0'
- php-version: '8.5'
symfony-version: '^7.0'
- php-version: '8.5'
symfony-version: '^8.0'

name: "PHPUnit tests, PHP version ${{ matrix.php-version }} - Symfony Version: ${{matrix.symfony-version}}"
steps:
- uses: actions/checkout@v6

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: |
~/.composer/cache
vendor
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-

- name: Install specific symfony version
run: composer require symfony/console:${{matrix.symfony-version}} symfony/dependency-injection:${{matrix.symfony-version}} -W

- name: Run PHPUnit
run: vendor/bin/phpunit -v
45 changes: 45 additions & 0 deletions .github/workflows/symfony-beta-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Run Symfony beta version(s)"
description: Runs on the latest beta version so that any breaking changes can be known about a bit in advanced.
on:
schedule:
- cron: "0 7 1 * *"

jobs:
test-beta:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: '8.4'
symfony-version: '^8.1'
- php-version: '8.5'
symfony-version: '^8.1'

name: "PHPUnit tests, PHP version ${{ matrix.php-version }} - Symfony Version: ${{matrix.symfony-version}}"
steps:
- uses: actions/checkout@v6

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: |
~/.composer/cache
vendor
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-

- name: Allow beta/dev versions of packages
run: composer config minimum-stability dev

- name: Install specific symfony version
run: composer require symfony/console:${{matrix.symfony-version}} symfony/dependency-injection:${{matrix.symfony-version}} -W

- name: Run PHPUnit
run: vendor/bin/phpunit -v
6 changes: 4 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
<!-- https://docs.phpunit.de/en/9.6/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ public function testCommandEntersRunloop(): void
$command = new TestEndlessCommand();

$application = new Application();
$application->add($command);

if (method_exists($application, 'addCommand')) {
$application->addCommand($command);
} else {
// FIXME: Once symfony/console:8.0 is the minimum required version we can drop the add
$application->add($command);
}

$application->setAutoExit(false);

$input = new ArrayInput([
Expand Down