Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
JonoB committed Apr 18, 2024
1 parent d90cfe1 commit f288619
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 31 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ jobs:
strategy:
matrix:
container: [
"kirschbaumdevelopment/laravel-test-runner:7.3",
"kirschbaumdevelopment/laravel-test-runner:7.4",
"kirschbaumdevelopment/laravel-test-runner:8.0"
"kirschbaumdevelopment/laravel-test-runner:8.2",
"kirschbaumdevelopment/laravel-test-runner:8.3"
]

container:
Expand Down Expand Up @@ -39,7 +38,7 @@ jobs:
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install composer dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Run Testsuite against MySQL
Expand All @@ -53,4 +52,4 @@ jobs:
env:
DB_CONNECTION: pgsql
DB_HOST: postgres
DB_PORT: 5432
DB_PORT: 5432
21 changes: 15 additions & 6 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
name: Format [PHP]

on: [push]
on:
pull_request:
paths:
- '**.php'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Run php-cs-fixer
uses: docker://oskarstark/php-cs-fixer-ga
uses: docker://oskarstark/php-cs-fixer-ga:3.13.0
with:
args: --config=.php-cs-fixer.php
args: --config=.php-cs-fixer.dist.php

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply php-cs-fixer changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 changes: 55 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('node_modules')
->exclude('bower_components')
->exclude('public')
->exclude('bootstrap')
->exclude('resources')
->exclude('storage')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php');

$config = new PhpCsFixer\Config();

return $config
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const'
],
'sort_algorithm' => 'alpha'
],
'no_unused_imports' => true,
'no_empty_statement' => true,
'no_useless_return' => true,
'not_operator_with_successor_space' => true,
'explicit_string_variable' => true,
'simple_to_complex_string_variable' => true,
'array_indentation' => true,
'blank_line_before_statement' => [
'statements' => [
'case',
'default',
'declare',
'do',
'goto',
'if',
'include',
'include_once',
'require',
'require_once',
'switch',
'try',
]
],
])
->setFinder($finder);
20 changes: 0 additions & 20 deletions .php-cs-fixer.php

This file was deleted.

0 comments on commit f288619

Please sign in to comment.