Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 632
Enhancement: Run friendsofphp/php-cs-fixer on GitHub Actions#559
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -9,6 +9,49 @@ on: | ||
| - "master" | ||
| jobs: | ||
| coding-standards: | ||
localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| name: "Coding Standards" | ||
| runs-on: "ubuntu-latest" | ||
| strategy: | ||
| matrix: | ||
| php-version: | ||
| - "7.3" | ||
| steps: | ||
| - name: "Checkout" | ||
| uses: "actions/checkout@v3" | ||
localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| - name: "Set up PHP" | ||
| uses: "shivammathur/setup-php@v2" | ||
localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| with: | ||
| coverage: "none" | ||
| extensions: "none, json, mbstring, tokenizer" | ||
| php-version: "${{ matrix.php-version }}" | ||
localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| - name: "Set up problem matchers for PHP" | ||
| run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" | ||
localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| - name: "Validate composer.json and composer.lock" | ||
| run: "composer validate --ansi --strict" | ||
localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| - name: "Determine composer cache directory" | ||
| run: "echo \"COMPOSER_CACHE_DIR=$(composer config cache-dir)\" >> $GITHUB_ENV" | ||
localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| - name: "Cache dependencies installed with composer" | ||
| uses: "actions/cache@v3" | ||
localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| with: | ||
| path: "${{ env.COMPOSER_CACHE_DIR }}" | ||
| key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}" | ||
| restore-keys: "php-${{ matrix.php-version }}-composer-" | ||
| - name: "Install dependencies with composer" | ||
| run: "composer install --ansi --no-interaction --no-progress" | ||
| - name: "Run friendsofphp/php-cs-fixer" | ||
| run: "vendor/bin/php-cs-fixer fix --ansi --config=.php-cs-fixer.php --diff --dry-run --verbose" | ||
| tests: | ||
| name: "Tests" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <?php | ||
| $finder = PhpCsFixer\Finder::create()->in(__DIR__); | ||
| $config = new PhpCsFixer\Config(); | ||
| $finder = $config->getFinder() | ||
| ->ignoreDotFiles(false) | ||
| ->in(__DIR__) | ||
| ->name(__FILE__); | ||
| $config->setRules([]); | ||
localheinz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| return $config; | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.