Skip to content

Commit

Permalink
Upgrade to Symfony 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fre5h authored Jun 7, 2022
1 parent e5dfde7 commit 4262e3e
Show file tree
Hide file tree
Showing 8 changed files with 264 additions and 199 deletions.
290 changes: 143 additions & 147 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,152 +1,148 @@
name: CI

on:
pull_request:
push:
branches:
- 'main'
pull_request:
push:
branches:
- 'main'

jobs:
composer-validate:
runs-on: ubuntu-latest
name: "Composer Validate"
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Validate composer.json'
run: composer validate --no-check-all --strict --no-check-lock

composer-install:
needs: composer-validate
runs-on: ubuntu-latest
name: "Composer Install"
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Install Dependencies'
run: composer install --prefer-dist --no-progress --no-interaction

code-style:
needs: composer-install
runs-on: ubuntu-latest
name: "Code Style"
strategy:
fail-fast: false
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
ini-values: memory_limit=-1
coverage: none
tools: composer:v2

- name: 'Install PHP dependencies with Composer'
run: composer install --prefer-dist --no-progress --optimize-autoloader
working-directory: './'

- name: 'Run CodeSniffer'
run: ./vendor/bin/phpcs ./ -p --encoding=utf-8 --extensions=php --ignore="vendor|Tests|src|public" --standard=./vendor/escapestudios/symfony2-coding-standard/Symfony

static-analysis:
needs: composer-install
runs-on: ubuntu-latest
name: "Static Analysis"
strategy:
fail-fast: false
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
ini-values: memory_limit=-1
coverage: none
tools: composer:v2

- name: 'Install PHP dependencies with Composer'
run: composer install --prefer-dist --no-progress --optimize-autoloader
working-directory: './'

- name: 'Run PHPStan'
run: ./vendor/bin/phpstan analyse --no-progress -c phpstan.neon ./

test:
needs: composer-install
runs-on: ubuntu-latest
name: "Tests (PHP ${{ matrix.php-version }} / Symfony ${{ matrix.symfony-version }})"
strategy:
fail-fast: false
matrix:
php-version:
- '7.4'
- '8.0'
- '8.1'
symfony-version:
- '5.3'
- '5.4'
- '6.0'
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
ini-values: memory_limit=-1
coverage: none
tools: composer:v2
env:
SYMFONY_VERSION: ${{ matrix.symfony-version }}

- name: 'Install PHP dependencies with Composer'
run: composer install --prefer-dist --no-progress --optimize-autoloader
working-directory: './'

- name: 'Run PHPUnit'
run: ./vendor/bin/phpunit -v -c phpunit.xml.dist

code-coverage:
needs: test
runs-on: ubuntu-latest
name: "Code Coverage"
strategy:
fail-fast: false
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
ini-values: memory_limit=-1
coverage: pcov
tools: composer:v2

- name: 'Install PHP dependencies with Composer'
run: composer install --prefer-dist --no-progress --optimize-autoloader
working-directory: './'

- name: 'Run PHPUnit with Code Coverage'
run: ./vendor/bin/phpunit -v -c phpunit.xml.dist --coverage-clover=coverage.xml

- name: 'Download Coverage Files'
uses: actions/download-artifact@v2
with:
path: reports

- name: 'Upload to Codecov'
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
fail_ci_if_error: true
verbose: true
composer-validate:
runs-on: ubuntu-latest
name: "Composer Validate"
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Validate composer.json'
run: composer validate --no-check-all --strict --no-check-lock

composer-install:
needs: composer-validate
runs-on: ubuntu-latest
name: "Composer Install"
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Install Dependencies'
run: composer install --prefer-dist --no-progress --no-interaction

code-style:
needs: composer-install
runs-on: ubuntu-latest
name: "Code Style"
strategy:
fail-fast: false
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
ini-values: memory_limit=-1
coverage: none
tools: composer:v2

- name: 'Install PHP dependencies with Composer'
run: composer install --prefer-dist --no-progress --optimize-autoloader
working-directory: './'

- name: 'Run CodeSniffer'
run: ./vendor/bin/phpcs ./ -p --encoding=utf-8 --extensions=php --ignore="vendor|Tests|src|public" --standard=./vendor/escapestudios/symfony2-coding-standard/Symfony

static-analysis:
needs: composer-install
runs-on: ubuntu-latest
name: "Static Analysis"
strategy:
fail-fast: false
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
ini-values: memory_limit=-1
coverage: none
tools: composer:v2

- name: 'Install PHP dependencies with Composer'
run: composer install --prefer-dist --no-progress --optimize-autoloader
working-directory: './'

- name: 'Run PHPStan'
run: ./vendor/bin/phpstan analyse --no-progress -c phpstan.neon ./

test:
needs: composer-install
runs-on: ubuntu-latest
name: "Tests (PHP ${{ matrix.php-version }} / Symfony ${{ matrix.symfony-version }})"
strategy:
fail-fast: false
matrix:
php-version:
- '8.1'
symfony-version:
- '6.1'
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
ini-values: memory_limit=-1
coverage: none
tools: composer:v2
env:
SYMFONY_VERSION: ${{ matrix.symfony-version }}

- name: 'Install PHP dependencies with Composer'
run: composer install --prefer-dist --no-progress --optimize-autoloader
working-directory: './'

- name: 'Run PHPUnit'
run: ./vendor/bin/phpunit -v -c phpunit.xml.dist

code-coverage:
needs: test
runs-on: ubuntu-latest
name: "Code Coverage"
strategy:
fail-fast: false
steps:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
ini-values: memory_limit=-1
coverage: pcov
tools: composer:v2

- name: 'Install PHP dependencies with Composer'
run: composer install --prefer-dist --no-progress --optimize-autoloader
working-directory: './'

- name: 'Run PHPUnit with Code Coverage'
run: ./vendor/bin/phpunit -v -c phpunit.xml.dist --coverage-clover=coverage.xml

- name: 'Download Coverage Files'
uses: actions/download-artifact@v2
with:
path: reports

- name: 'Upload to Codecov'
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
fail_ci_if_error: true
verbose: true
10 changes: 5 additions & 5 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
checks:
php: true
php: true

filter:
excluded_paths:
- vendor/*
- Tests/*
excluded_paths:
- vendor/*
- Tests/*

before_commands:
- "composer install --prefer-dist"
- "composer install --prefer-dist"
24 changes: 12 additions & 12 deletions .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ preset: symfony
tab-width: 4
use-tabs: false
enabled:
- combine_consecutive_unsets
- ordered_class_elements
- alpha_ordered_imports
- declare_strict_types
- phpdoc_order
- combine_consecutive_unsets
- ordered_class_elements
- alpha_ordered_imports
- declare_strict_types
- phpdoc_order
disabled:
- no_superfluous_phpdoc_tags_symfony
- native_function_invocation_symfony
- no_superfluous_phpdoc_tags_symfony
- native_function_invocation_symfony
finder:
exclude:
- "Tests"
- "vendor"
name:
- "*.php"
exclude:
- "Tests"
- "vendor"
name:
- "*.php"
Loading

0 comments on commit 4262e3e

Please sign in to comment.