Skip to content

Commit

Permalink
Merge pull request #44 from OskarStark/feature/cs-ci
Browse files Browse the repository at this point in the history
Add PHP-CS-Fixer to CI
  • Loading branch information
slunak authored Aug 25, 2024
2 parents 2585187 + b014fcb commit f62c327
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit f62c327

Please sign in to comment.