-
Notifications
You must be signed in to change notification settings - Fork 15
Replace Makefile with Castor task runner #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+92
−27
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
dbc6ed4
Initial plan
Copilot e2a201a
Replace Makefile with Castor task runner
Copilot d471dd0
Improve Castor installation documentation with cross-platform info
Copilot f08c463
Simplify README to only link to Castor installation docs
Copilot 015b4f8
Add castor.php to PHPStan excluded paths
Copilot 7d665db
Use Castor in GitHub Actions for CS and PHPStan checks
Copilot 872b0bf
Fix setup-castor action version to v0.1.0
Copilot 760a579
Update .github/workflows/ci.yml
damienalexandre 742ff92
Update CHANGELOG.md
damienalexandre 3a074f4
Refactor cs task to use --dry-run option instead of separate task
Copilot 6286f86
Fix CS: remove trailing whitespace in castor.php
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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/[email protected] | ||
|
|
||
| - 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 | ||
|
|
@@ -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/[email protected] | ||
|
|
||
| - 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 }})" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,10 @@ | |
| /composer.lock | ||
| /vendor | ||
|
|
||
| # Castor | ||
| /castor | ||
| /.castor.stub.php | ||
|
|
||
| # Temporary | ||
| /tests/app/var | ||
| /tests/app/public/bundles | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 <[email protected]> | ||
| * | ||
| * 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'); | ||
| } | ||
pyrech marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| #[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'); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,4 @@ parameters: | |
| excludePaths: | ||
| - vendor | ||
| - tests | ||
| - castor.php | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.