Skip to content

Commit

Permalink
Workflows added
Browse files Browse the repository at this point in the history
  • Loading branch information
lloc committed Dec 2, 2024
1 parent f271b5f commit 7740305
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run PHPStan

on:
push:
branches:
- main
pull_request:

jobs:
phpstan:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 'latest'
coverage: none
tools: composer, cs2pr

- name: Install PHP dependencies
uses: ramsey/composer-install@v2
with:
composer-options: '--prefer-dist --no-scripts'

- name: PHPStan
run: composer phpstan
19 changes: 18 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
name: UnitTests
name: Run UnitTests

on: [push]

jobs:
unit-tests:
name: UnitTests
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 'latest'
coverage: none
tools: composer, cs2pr

- name: Composer dependencies
run: composer install

- name: Install PHP dependencies
uses: ramsey/composer-install@v2
with:
composer-options: '--prefer-dist --no-scripts'

- name: Run Testsuite
run: composer test
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"scripts": {
"test": "vendor/bin/phpunit",
"coverage": "@php -d xdebug.mode=coverage vendor/bin/phpunit --coverage-html reports/php/coverage",
"analyze": "vendor/bin/phpstan analyze --memory-limit 2048M",
"phpstan": "vendor/bin/phpstan analyze --memory-limit 2048M",
"diagram": "vendor/bin/php-class-diagram --php7 includes > plantuml_gist.puml",
"format": "phpcbf --standard=phpcs.xml --report-summary --report-source",
"lint": "phpcs --standard=phpcs.xml"
Expand Down

0 comments on commit 7740305

Please sign in to comment.