Skip to content

Commit

Permalink
Harmonize CI workflow (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Oct 17, 2023
1 parent 8491550 commit ce56198
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 220 deletions.
131 changes: 0 additions & 131 deletions .github/workflows/code_checks.yaml

This file was deleted.

104 changes: 104 additions & 0 deletions .github/workflows/php.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: PHP

on:
pull_request:
branches:
- '3.5'
- '3.6'
push: null

permissions: {}

concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

jobs:
tests:
name: '${{ matrix.php }} / Symfony ${{ matrix.symfony_version }} / ${{ matrix.dependencies }} / ${{ matrix.os }}'
strategy:
matrix:
os:
- 'ubuntu-22.04'
php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
dependencies:
- 'lowest'
- 'highest'
symfony_version:
- '~5.4.9'
- '~6.3.0'
include:
- os: 'windows-2022'
php: '8.1'
dependencies: 'highest'
symfony_version: '~6.3.0'
exclude:
- os: 'ubuntu-22.04'
php: '8.0'
dependencies: 'lowest'
symfony_version: '~6.3.0'
- os: 'ubuntu-22.04'
php: '8.0'
dependencies: 'highest'
symfony_version: '~6.3.0'
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: '--with=symfony/console:${{ matrix.symfony_version }}'

- run: composer exec -- phpunit --testsuite EndToEnd

- run: composer exec -- phpunit --testsuite Integration

- run: composer exec -- phpunit --testsuite Unit

static_analysis:
name: Static analysis
strategy:
matrix:
include:
- php: '8.1'
symfony_version: '~6.3.0'
dependencies: 'highest'
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: '--with=symfony/console:${{ matrix.symfony_version }}'

- run: composer normalize --dry-run

- uses: actions/cache@v3
with:
path: .php-cs-fixer.cache
key: php-cs-fixer-cache

- uses: actions/cache@v3
with:
path: /tmp/phpstan
key: phpstan-cache

- run: composer run crunz:analyze
61 changes: 0 additions & 61 deletions composer-install.php

This file was deleted.

31 changes: 3 additions & 28 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ parameters:
path: src/Console/Command/TaskGeneratorCommand.php

-
message: "#^Cannot call method ask\\(\\) on mixed\\.$#"
message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:ask\\(\\)\\.$#"
count: 1
path: src/Console/Command/TaskGeneratorCommand.php

Expand Down Expand Up @@ -115,21 +115,11 @@ parameters:
count: 1
path: src/Event.php

-
message: "#^Call to method createLock\\(\\) on an unknown class Symfony\\\\Component\\\\Lock\\\\Factory\\.$#"
count: 1
path: src/Event.php

-
message: "#^Cannot cast mixed to string\\.$#"
count: 1
path: src/Event.php

-
message: "#^Class Symfony\\\\Component\\\\Lock\\\\StoreInterface not found\\.$#"
count: 2
path: src/Event.php

-
message: "#^Instanceof between Closure and Closure will always evaluate to true\\.$#"
count: 1
Expand All @@ -140,11 +130,6 @@ parameters:
count: 1
path: src/Event.php

-
message: "#^Instanceof between Symfony\\\\Component\\\\Lock\\\\StoreInterface and Symfony\\\\Component\\\\Lock\\\\StoreInterface will always evaluate to true\\.$#"
count: 1
path: src/Event.php

-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 1
Expand All @@ -165,21 +150,11 @@ parameters:
count: 3
path: src/Event.php

-
message: "#^Parameter \\$store of method Crunz\\\\Event\\:\\:preventOverlapping\\(\\) has invalid type Symfony\\\\Component\\\\Lock\\\\StoreInterface\\.$#"
count: 1
path: src/Event.php

-
message: "#^Property Crunz\\\\Event\\:\\:\\$lock \\(Symfony\\\\Component\\\\Lock\\\\Lock\\) does not accept Symfony\\\\Component\\\\Lock\\\\SharedLockInterface\\.$#"
count: 1
path: src/Event.php

-
message: "#^Property Crunz\\\\Event\\:\\:\\$lockFactory has unknown class Symfony\\\\Component\\\\Lock\\\\Factory as its type\\.$#"
count: 1
path: src/Event.php

-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 1
Expand Down Expand Up @@ -396,12 +371,12 @@ parameters:
path: tests/EndToEnd/WrongTaskTest.php

-
message: "#^Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Console\\\\Tester\\\\CommandTester and 'setInputs' will always evaluate to true\\.$#"
message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:setInputStream\\(\\)\\.$#"
count: 1
path: tests/Functional/TaskGeneratorTest.php

-
message: "#^Cannot call method setInputStream\\(\\) on mixed\\.$#"
message: "#^Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Console\\\\Tester\\\\CommandTester and 'setInputs' will always evaluate to true\\.$#"
count: 1
path: tests/Functional/TaskGeneratorTest.php

Expand Down

0 comments on commit ce56198

Please sign in to comment.