Skip to content

feature #227 Bump dependencies. test against symfony 7 (michnovka) #455

feature #227 Bump dependencies. test against symfony 7 (michnovka)

feature #227 Bump dependencies. test against symfony 7 (michnovka) #455

Workflow file for this run

name: CI
on:
workflow_dispatch: ~
push:
branches:
- 2.x
pull_request: ~
jobs:
lint:
name: Lint
runs-on: 'ubuntu-latest'
timeout-minutes: 5
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
- name: 'Require Doctrine MongoDB dependencies'
run: composer require --no-update --ignore-platform-reqs --dev --no-interaction --ansi "doctrine/mongodb-odm:^2.4" "doctrine/mongodb-odm-bundle:^4.5.1"
- name: 'Install dependencies'
id: deps
run: |
echo "::group::Install project deps"
composer update --prefer-dist --ignore-platform-reqs --ansi
echo "::endgroup::"
echo "::group::Install PHPUnit"
vendor/bin/simple-phpunit install
echo "::endgroup::"
env:
SYMFONY_REQUIRE: "6.4*dev"
- name: 'Lint - PHP CS Fixer'
if: always() && steps.deps.outcome == 'success'
run: |
echo "::group::Install PHP CS Fixer"
make php-cs-fixer.phar
echo "::endgroup::"
./php-cs-fixer.phar fix --dry-run --no-interaction --diff
- name: 'Lint - PHPStan'
if: always() && steps.deps.outcome == 'success'
run: ./vendor/bin/phpstan
test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
continue-on-error: ${{ matrix.allow-failure == 1 }}
strategy:
fail-fast: false
matrix:
include:
# Lowest deps
- name: 'Test lowest deps [Linux, PHP 8.1]'
os: 'ubuntu-latest'
php: '8.1'
composer-flags: '--prefer-lowest'
allow-unstable: true
mongodb: true
# Previous Symfony versions
# …
# Previous PHP versions
# …
# Most recent versions
- name: 'Test Symfony 5.4 [Linux, PHP 8.1]'
os: 'ubuntu-latest'
php: '8.1'
symfony: '5.4.*@dev'
allow-unstable: true
mongodb: true
mysql: true
- name: 'Test Symfony 5.4 [Windows, PHP 8.1]'
os: 'windows-latest'
php: '8.1'
symfony: '5.4.*@dev'
mongodb: true
mysql: true
allow-unstable: true
- name: 'Test Symfony 6.3 [Linux, PHP 8.1]'
os: 'ubuntu-latest'
php: '8.1'
symfony: '6.3.*@dev'
mongodb: true
mysql: true
allow-unstable: true
- name: 'Test Symfony 6.4 [Linux, PHP 8.1]'
os: 'ubuntu-latest'
php: '8.1'
symfony: '6.4.*@dev'
allow-unstable: true
mysql: true
mongodb: true
- name: 'Test Symfony 7.0 [Linux, PHP 8.2]'
os: 'ubuntu-latest'
php: '8.2'
symfony: '7.0.*@dev'
allow-unstable: true
mysql: true
mongodb: true
mongodbnew: true
# Bleeding edge (unreleased dev versions where failures are allowed)
- name: 'Test next Symfony 7.1 [Linux, PHP 8.2] (allowed failure)'
os: 'ubuntu-latest'
php: '8.2'
symfony: '7.1.*@dev'
composer-flags: '--ignore-platform-req php'
allow-unstable: true
allow-failure: true
mysql: true
mongodb: true
mongodbnew: true
- name: 'Test next Symfony 7.1 [Linux, PHP 8.3] (allowed failure)'
os: 'ubuntu-latest'
php: '8.3'
symfony: '7.1.*@dev'
composer-flags: '--ignore-platform-req php'
allow-unstable: true
allow-failure: true
mysql: true
mongodb: true
mongodbnew: true
steps:
- name: 'Set git to use LF'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo_sqlite ${{ matrix.mongodb && ', mongodb' }} ${{ matrix.mysql && ', pdo_mysql' }}
coverage: none
tools: 'composer:v2,flex'
- name: 'Start MongoDB (Linux)'
uses: supercharge/[email protected]
if: ${{ matrix.mongodb && matrix.os == 'ubuntu-latest' }}
- name: 'Start MongoDB (Windows)'
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install mongodb.install --version=7.0.4 --allow-downgrade
if: ${{ matrix.mongodb && matrix.os == 'windows-latest' }}
- name: 'Shutdown Default Ubuntu MySQL'
run: sudo service mysql stop
if: ${{ matrix.mysql && matrix.os == 'ubuntu-latest' }}
- name: 'Setup MySQL'
uses: ankane/setup-mysql@v1
with:
mysql-version: '8.0.35'
database: doctrine_tests
if: ${{ matrix.mysql }}
- name: 'Get composer cache directory'
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
if: ${{ matrix.os != 'windows-latest' }}
- name: 'Cache dependencies'
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-${{ hashFiles('**/composer.json') }}-flags-${{ matrix.composer-flags }}
restore-keys: ${{ runner.os }}-composer-
if: ${{ matrix.os != 'windows-latest' }}
- name: 'Allow unstable packages'
run: composer config minimum-stability dev
if: ${{ matrix.allow-unstable }}
- name: 'Require Doctrine MongoDB dependencies for old symfony'
run: composer require --no-update ${{ matrix.composer-flags }} --dev --no-interaction --ansi "doctrine/mongodb-odm:^2.4" "doctrine/mongodb-odm-bundle:^4.5.1"
if: ${{ matrix.mongodb && !matrix.mongodbnew }}
- name: 'Require Doctrine MongoDB dependencies for new symfony'
run: composer require --no-update ${{ matrix.composer-flags }} --dev --no-interaction --ansi "doctrine/mongodb-odm:^2.6" "doctrine/mongodb-odm-bundle:5.0.x-dev"
if: ${{ matrix.mongodb && matrix.mongodbnew }}
- name: 'Install dependencies'
run: |
echo "::group::Install project deps"
composer update --prefer-dist ${{ matrix.composer-flags }} --ansi
echo "::endgroup::"
echo "::group::Install PHPUnit"
vendor/bin/simple-phpunit install
echo "::endgroup::"
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
- name: 'Set Doctrine MySQL DSN (Linux)'
run: echo "DOCTRINE_DBAL_URL=pdo-mysql://[email protected]:3306/doctrine_tests?serverVersion=8.0.35" >> $GITHUB_ENV
if: ${{ matrix.mysql && matrix.os == 'ubuntu-latest' }}
- name: 'Set Doctrine MySQL DSN (Windows)'
run: echo "DOCTRINE_DBAL_URL=pdo-mysql://[email protected]:3306/doctrine_tests?serverVersion=8.0.35" >> $env:GITHUB_ENV
if: ${{ matrix.mysql && matrix.os == 'windows-latest' }}
- name: 'Run PHPUnit tests'
run: vendor/bin/simple-phpunit --testdox --verbose