Skip to content

Commit

Permalink
Added to keep the previous constraint in front, added phpstan and cs-… (
Browse files Browse the repository at this point in the history
#6)

* Added to keep the previous constraint in front, added phpstan and cs-fixer

* Added github actions, fixed code formating

* Fixed command description

---------

Co-authored-by: Martins Rucevskis <[email protected]>
  • Loading branch information
MartinsRucevskis and Martins Rucevskis authored Nov 21, 2023
1 parent e2137fc commit a45ac72
Show file tree
Hide file tree
Showing 19 changed files with 887 additions and 99 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Code style
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.1'
- uses: actions/checkout@v3
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Run php-cs-fixer
run: ./vendor/bin/php-cs-fixer fix --config=phpCsFixerConfig.php --dry-run --diff


22 changes: 22 additions & 0 deletions .github/workflows/php-stan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Static analysis

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
PHP-Stan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.1'
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Run PHPStan
uses: php-actions/phpstan@v3
22 changes: 22 additions & 0 deletions .github/workflows/php-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
PHP-Unit:

runs-on: ubuntu-latest

steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.1'
- uses: actions/checkout@v3
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Execute tests
run: ./vendor/bin/phpunit
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
},
"require-dev": {
"composer/composer": "^2.0",
"phpunit/phpunit": "10.4.2"
"phpunit/phpunit": "10.4.2",
"phpstan/phpstan": "^1.10",
"friendsofphp/php-cs-fixer": "^3.38"
},
"autoload": {
"psr-4": {
Expand All @@ -23,4 +25,4 @@
"extra": {
"class": "MartinsR\\ComposerConstraintUpdater\\ComposerPlugin"
}
}
}
Loading

0 comments on commit a45ac72

Please sign in to comment.