Skip to content

Commit

Permalink
Add PHP Linting (Pint) github action
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Nov 13, 2022
1 parent 0b467b7 commit 79da002
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PHP Linting (Pint)

on: [push, pull_request]

jobs:
phplint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Composer Install
run: composer install --no-interaction --ignore-platform-reqs

- name: Remove Extensions & Themes
run: rm -rf extensions themes

- name: Run Laravel Pint
run: ./vendor/bin/pint

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: PHP Linting (Pint) - Fix styling
skip_fetch: true
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests

on: [push, pull_request]

jobs:
PHPUnitTests:
runs-on: ubuntu-latest

strategy:
max-parallel: 6
matrix:
php: ['7.4', '8.0', '8.1']
fail-fast: false

name: 'PHPUnit Tests ${{ matrix.php }} / ${{ matrix.dbName }}'

steps:
- name: Checkout changes
uses: actions/checkout@v1

- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, gd, xml, sqlite

- name: Install composer dependencies
run: composer install --no-interaction --no-progress --no-scripts

- name: Run PHPUnit Test Suite
run: ./vendor/bin/phpunit ./tests
21 changes: 21 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"rules": {
"method_chaining_indentation": true,
"logical_operators": true,
"simplified_null_return": false,
"cast_spaces": false,
"no_unreachable_default_argument_value": false,
"no_alternative_syntax": false,
"not_operator_with_successor_space": false,
"no_trailing_comma_in_list_call": false,
"phpdoc_summary": false,
"braces": false,
"self_accessor": false,
"Laravel/laravel_phpdoc_separation": false,
"Laravel/laravel_phpdoc_alignment": false,
"no_trailing_comma_in_singleline": false,
"blank_line_before_statement": {
"statements": ["declare", "return", "throw", "try"]
}
}
}

0 comments on commit 79da002

Please sign in to comment.