-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from OskarStark/feature/cs-ci
Add PHP-CS-Fixer to CI
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -10,6 +10,51 @@ env: | |
REQUIRED_PHP_EXTENSIONS: "curl, json" | ||
|
||
jobs: | ||
coding-standards: | ||
name: "Coding Standards" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.3" | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@v3 | ||
|
||
- | ||
name: "Install PHP with extensions" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" | ||
tools: "composer:v2" | ||
|
||
- | ||
name: "Install dependencies with composer" | ||
uses: "ramsey/[email protected]" | ||
with: | ||
composer-options: "--no-scripts" | ||
|
||
- | ||
name: "Create cache directory for friendsofphp/php-cs-fixer" | ||
run: "mkdir -p .build/php-cs-fixer" | ||
|
||
- | ||
name: "Cache cache directory for friendsofphp/php-cs-fixer" | ||
uses: "actions/cache@v4" | ||
with: | ||
path: ".build/php-cs-fixer" | ||
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}" | ||
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-" | ||
|
||
- | ||
name: "Run friendsofphp/php-cs-fixer" | ||
run: "vendor/bin/php-cs-fixer fix --diff --verbose" | ||
|
||
composer-validate: | ||
name: "Validate composer.json" | ||
|
||
|