Skip to content
Merged
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
58 changes: 40 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ on:
branches: [ main ]

jobs:
test:
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version:
- '8.4'
- '8.5'
dependency-versions:
- 'lowest'
- 'highest'

name: PHP ${{ matrix.php-version }}
name: PHP ${{ matrix.php-version }} ${{ matrix.dependency-versions }}

steps:
- uses: actions/checkout@v4
Expand All @@ -26,20 +30,41 @@ jobs:
with:
php-version: ${{ matrix.php-version }}

- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install dependencies
uses: "ramsey/composer-install@v3"
with:
dependency-versions: ${{ matrix.dependency-versions }}

- name: Run tests
run: vendor/bin/phpunit

checks:
runs-on: ubuntu-latest

name: Checks

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-version }}-
php-version: '8.5'

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Install dependencies
run: composer install --prefer-dist --no-progress
uses: "ramsey/composer-install@v3"

- name: Check composer.json normalization
run: composer normalize --diff --dry-run
Expand All @@ -53,13 +78,10 @@ jobs:
run: vendor/bin/composer-dependency-analyser

- name: Run PHP CS Fixer
run: vendor/bin/php-cs-fixer check --diff
run: vendor/bin/php-cs-fixer check --diff --ansi

- name: Run Twig CS Fixer
run: vendor/bin/twig-cs-fixer lint
run: vendor/bin/twig-cs-fixer lint --ansi

- name: Run PHPStan
run: vendor/bin/phpstan analyse

- name: Run tests
run: vendor/bin/phpunit
run: vendor/bin/phpstan analyse --ansi
3 changes: 1 addition & 2 deletions bin/graphql-client-code-generator
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ if ($input->getFirstArgument() === null) {

$application = new Application('graphql-client-code-generator', '1.0.0');

// TODO symfony/console:7.4 Remove `new Command()->setCode` wrapping everywhere
$application->add(new Command('generate')->setCode(new GenerateCommand(new Filesystem())));
$application->addCommand(new Command()->setCode(new GenerateCommand(new Filesystem())));
$application->run($input);
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"composer-runtime-api": "^2.0",
"nikic/php-parser": "^5.6",
"phpstan/phpstan": "^2.1",
"ruudk/code-generator": "^0.4.3",
"symfony/console": "^7.3",
"symfony/filesystem": "^7.3",
"symfony/finder": "^7.3",
"symfony/string": "^7.3",
"symfony/type-info": "^7.3",
"ruudk/code-generator": "^0.4.4",
"symfony/console": "^7.4 || ^8.0",
"symfony/filesystem": "^7.4 || ^8.0",
"symfony/finder": "^7.4 || ^8.0",
"symfony/string": "^7.4 || ^8.0",
"symfony/type-info": "^7.4 || ^8.0",
"webmozart/assert": "^1.11",
"webonyx/graphql-php": "^15.24.0"
},
Expand All @@ -37,9 +37,9 @@
"shipmonk/composer-dependency-analyser": "^1.8",
"shipmonk/dead-code-detector": "^0.13.2",
"staabm/phpstan-todo-by": "^0.3.0",
"symfony/dependency-injection": "^7.3",
"symfony/dotenv": "^7.3",
"symfony/var-dumper": "^7.3",
"symfony/dependency-injection": "^7.4 || ^8.0",
"symfony/dotenv": "^7.4 || ^8.0",
"symfony/var-dumper": "^7.4 || ^8.0",
"ticketswap/php-cs-fixer-config": "^1.0",
"ticketswap/phpstan-error-formatter": "^1.1",
"twig/twig": "^3.21",
Expand Down
Loading