Skip to content

Commit

Permalink
Added running auto-test for every supported lowest major version of t…
Browse files Browse the repository at this point in the history
…he Symfony

Fixed problem with coverage
  • Loading branch information
adrenalinkin committed Jul 10, 2021
1 parent b9e3a19 commit 18427ea
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
34 changes: 24 additions & 10 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,44 @@ on: [push, pull_request]

jobs:
tests:
name: "PHP ${{ matrix.php }} with ${{ matrix.dependency }} dependencies"
name: "PHP ${{ matrix.php }} + Symfony ${{ matrix.symfony }} + Composer ${{ matrix.dependency }}"
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
include:
# Lowest PHP with lowest dependencies
# Lowest PHP with lowest dependencies for every supported lowest major version of the Symfony
- php: '7.1'
coverage: xdebug
dependency: lowest
# All supported php versions with highest dependencies
symfony: '^3.4'
- php: '7.1'
coverage: xdebug
dependency: lowest
symfony: '^4.0'
- php: '7.2'
coverage: xdebug
dependency: lowest
symfony: '^5.0'

# All supported php versions with highest dependencies for any supported Symfony version
- php: '7.1'
coverage: xdebug
dependency: highest
symfony: 'any'
- php: '7.2'
coverage: pcov
dependency: highest
symfony: 'any'
- php: '7.3'
coverage: pcov
dependency: highest
symfony: 'any'
- php: '7.4'
coverage: pcov
dependency: highest
symfony: 'any'

steps:
- name: Checkout source
Expand All @@ -39,6 +53,12 @@ jobs:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage }}

- name: Require Symfony version
if: matrix.symfony != 'any'
run: |
composer global require --no-interaction --no-progress symfony/flex:^1.11
composer config extra.symfony.require ${{ matrix.symfony }}
- name: Validate composer.json
run: composer validate

Expand All @@ -47,12 +67,6 @@ jobs:
with:
dependency-versions: ${{ matrix.dependency }}

- name: Cache PHPUnit
uses: actions/cache@v2
with:
path: vendor/bin/.phpunit
key: phpunit-${{ matrix.php }}

- name: Run test suite
run: ./vendor/bin/simple-phpunit -v

Expand All @@ -64,7 +78,7 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "PHP ${{ matrix.php }} with ${{ matrix.dependency }} dependencies"
COVERALLS_FLAG_NAME: "PHP ${{ matrix.php }} + Symfony ${{ matrix.symfony }} + Composer ${{ matrix.dependency }}"
with:
timeout_seconds: 60
max_attempts: 3
Expand Down
6 changes: 5 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.7/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
Expand Down Expand Up @@ -32,4 +32,8 @@
<logging>
<log type="coverage-clover" target="var/build/clover.xml"/>
</logging>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
</phpunit>

0 comments on commit 18427ea

Please sign in to comment.