Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
34 changes: 27 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
args: --config=.php-cs-fixer.php --diff --dry-run
php-version: '8.3'
extensions: mbstring, xml

- name: Setup Castor
uses: castor-php/setup-castor@v1.0.0

- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction

- name: Run PHP-CS-Fixer check
run: castor cs:dry-run

phpstan:
name: PHPStan
Expand All @@ -27,10 +37,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: PHPStan
uses: docker://oskarstark/phpstan-ga
env:
REQUIRE_DEV: true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, xml

- name: Setup Castor
uses: castor-php/setup-castor@v0.1.0

- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction

- name: Run PHPStan
run: castor phpstan

ci:
name: "Tests (PHP ${{ matrix.php-version }}, Symfony ${{ matrix.symfony }})"
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
/composer.lock
/vendor

# Castor
/castor
/.castor.stub.php

# Temporary
/tests/app/var
/tests/app/public/bundles
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes between versions

## Unreleased

* Replaced Makefile with Castor task runner
* Added development documentation for Castor

## 1.10.0 (2026-02-03)

* Added support for PHP 8.5
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ changes, improvements or alternatives may be given).
Run the tests using the following script:

```shell
make test
castor test
```

## Manual testing
Expand All @@ -70,7 +70,7 @@ Use [PHP CS fixer](https://cs.symfony.com/) to make your code compliant with
GifExceptionBundle's coding standards:

```shell
make cs
castor cs
```

## Keeping your fork up-to-date
Expand Down
18 changes: 0 additions & 18 deletions Makefile

This file was deleted.

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@ Although it would probably make more sense to use the former and push up the opt

It uses [gifsicle](https://www.lcdf.org/gifsicle/) to optimize gifs via the [image-optimizer](https://github.com/psliwa/image-optimizer) library.

## Development

This project uses [Castor](https://castor.jolicode.com/) as a task runner for common development tasks.

To install Castor, see the [installation documentation](https://castor.jolicode.com/getting-started/installation).

Available tasks:

```shell
castor list # List all available tasks
castor test # Run the test suite
castor cs # Fix PHP coding standards
castor cs:dry-run # Check PHP coding standards
castor phpstan # Run static analysis
```

## Further documentation

You can see the current and past versions using one of the following:
Expand Down
38 changes: 38 additions & 0 deletions castor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

/*
* This file is part of the GifExceptionBundle project.
*
* (c) JoliCode <coucou@jolicode.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Castor\Attribute\AsTask;

use function Castor\run;

#[AsTask(description: 'Fix PHP CS')]
function cs(): void
{
run('vendor/bin/php-cs-fixer fix --verbose');
}

#[AsTask(name: 'cs:dry-run', description: 'Test if PHP CS is correct')]
function cs_dry_run(): void
{
run('vendor/bin/php-cs-fixer fix --verbose --dry-run');
}

#[AsTask(description: 'Run the test suite')]
function test(): void
{
run('vendor/bin/simple-phpunit');
}

#[AsTask(description: 'Run static analysis')]
function phpstan(): void
{
run('vendor/bin/phpstan analyse -c phpstan.neon');
}
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ parameters:
excludePaths:
- vendor
- tests
- castor.php
Loading